From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Wozniak Date: Wed, 09 Mar 2005 09:37:25 -0500 Subject: [U-Boot-Users] -nostdinc In-Reply-To: <20050309093922.9DE4DC1510@atlas.denx.de> References: <20050309093922.9DE4DC1510@atlas.denx.de> Message-ID: <422F0A25.3080109@mc.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Thanks for the kind reply. Wolfgang Denk wrote: > In message <422E60FD.50108@mc.com> you wrote: > >>Having lots of fun with U-boot on our custom PPC440GX board. We're also >>pretty far along on developing a loadable "u-boot application" for this >>board. > > Congrats :-) > >>I've noticed that -nostdinc is used for many of the compiles. When I > > It should be used for _all_ compiles of files that get linked into > the U-Boot image. Please point out if we're missing any (of course it > is NOT used for any tools that will run on the host system, like > mkimage etc.). I haven't seen any yet. >>attempted to include stdlib.h and atoi() in our application, the >>compiler could not find the file. > > That's a good thing as it prevented you to do a stupind thing ;-) > >>Further examination of the U-Boot code-base shows little or no use of >>stdlib.h. Is this to keep the overall binary size to a minimum? > > It is to make U-Boot self-contained, i. e. independent of any > external libraries etc. That's a good thing. >>Any other reason for not adding this library to build? One simple > > Yes. You don;t need it. > >>alternative is to include our own atoi() source code. > > Don't reinvent the wheel. Don't bloat the code by multiple implemen- > tations of the same function. Use simple_strtoul() instead. Ahhh, I was wondering how U-Boot handled this common task. I didn't look far enough. > Best regards, > > Wolfgang Denk >