* [U-Boot-Users] -nostdinc
@ 2005-03-09 2:35 Andrew Wozniak
2005-03-09 9:39 ` Wolfgang Denk
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Wozniak @ 2005-03-09 2:35 UTC (permalink / raw)
To: u-boot
Hello,
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.
I've noticed that -nostdinc is used for many of the compiles. When I
attempted to include stdlib.h and atoi() in our application, the
compiler could not find the file.
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?
Any other reason for not adding this library to build? One simple
alternative is to include our own atoi() source code.
Thanks and best regards, Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot-Users] -nostdinc
2005-03-09 2:35 [U-Boot-Users] -nostdinc Andrew Wozniak
@ 2005-03-09 9:39 ` Wolfgang Denk
2005-03-09 14:37 ` Andrew Wozniak
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2005-03-09 9:39 UTC (permalink / raw)
To: u-boot
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.).
> 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.
> 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.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
About the use of language: it is impossible to sharpen a pencil with
a blunt ax. It is equally vain to try to do it with ten blunt axes
instead. -- Edsger Dijkstra
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot-Users] -nostdinc
2005-03-09 9:39 ` Wolfgang Denk
@ 2005-03-09 14:37 ` Andrew Wozniak
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Wozniak @ 2005-03-09 14:37 UTC (permalink / raw)
To: u-boot
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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-03-09 14:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-09 2:35 [U-Boot-Users] -nostdinc Andrew Wozniak
2005-03-09 9:39 ` Wolfgang Denk
2005-03-09 14:37 ` Andrew Wozniak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox