[PATCH] diff portability fixes

Cathey, Jim jcathey at ciena.com
Wed Feb 10 18:39:33 UTC 2010


>That's along the lines of inserting unnecessary 
>spaces in if() statements before the parentheses.

'Unnecessary' is in the eye of the beholder.  In my
world view, spaces before the parenthesis are what
indicate (mentally) that we are NOT referring
to a function call.  Gnu apparently interprets this
little cue the other way.  (Not sure why, C's introduction
to the world did it 'my' way.)

You can take it to a stupid level and dispense with all
unnecessary (syntactically) whitespace, including newlines!
But I prefer a form of code that has a structure that I
recognize.  (Which is largely old-school K&R, btw.)

>We removed them for readability, not because some broken 
>compiler couldn't handle them.

This has come up before.  The entire world's code development
is not conducted entirely on the Gnu toolset.  Especially in
the embedded world, where cross-development is so prevalent.
There are a lot of worthy toolsets that aren't Gnu based (Green
Hills, Diab, etc.) and which may not be up on all the latest
gcc-isms.  Nor even, perhaps, on the latest C99-isms.

If it isn't truly required, for an embedded toolbox like BB it
makes a lot of sense to stick with a rather sparse (early)
syntax of C.

I suppose the developers of BB could take it to a parochial latest
gcc only, latest glibc only, latest Linux kernel only status,
but that would cut it off from a lot of potential uses.  I would
vote against it, for what it's worth.

-- Jim






More information about the busybox mailing list