[BusyBox] [PATCH] networking/ping.c
Dan Kegel
dank at kegel.com
Fri Feb 1 08:11:03 UTC 2002
Erik Andersen wrote:
>
> On Thu Jan 31, 2002 at 10:50:58AM -0800, Matt Kraai wrote:
> > On Thu, Jan 31, 2002 at 10:42:44AM -0800, Dan Kegel wrote:
> > > Neal H Walfield wrote:
> > > > > Why did you make noresp a nested function?
> > > >
> > > > It permits us to elide the global variables hostname in the
> > > > CONFIG_FEATURE_FANCY_PING case.
> > >
> > > Is it me, or is someone else on crack here? Since when are
> > > nested functions legal C?
> >
> > It looks like it is a GCC C extension[1]. Erik, is it OK to use
> > these?
>
> We already use gcc-isms with __attribute__ tags and such, so
> sure I don't see why any reason why not.
The attribute tags could be finessed away with the preprocessor
if someone really wanted to build busybox with a different compiler,
but nested functions cannot.
I've been using gcc since way back when, and I've *never* seen
anyone use nested functions in C. This makes me suspect they're
not well tested. And as if to prove that, on the gdb mailing list
today, someone pointed to
http://sources.redhat.com/ml/gdb-patches/2001-07/msg00714.html
in a message about problems in gdb with nested functions.
Take it from an old C hand: don't use this particular extension
if you can help it. It would be much more trouble than it's worth.
- Dan
More information about the busybox
mailing list