patch to un-K&R-ify libkern

Dave Cuthbert dacut at neolinear.com
Tue Jan 27 16:29:30 PST 2004


Joerg Sonnenberger wrote:
Both also issue a diagnostic (gcc error, SunPro warning) about:

   void x(int);
   void x() { return; }


This is simply invalid ;-) SunPro is broken or at least not a conforming
compiler for accepting this code.
Heh... well, the standards only require a diagnostic, which can range
from printing "No!" to a teletype in Antarctica to setting your kitchen
on fire.  Such implementations are still conforming, though not terribly
useful. :-)
This is also a good example of why arguments about standards compliance
are silly...
Anyway, the actual SunPro diagnostic looks like:
"v.c", line 4: warning: identifier redeclared: x
        current : function() returning void
        previous: function(...) returning void : "v.c", line 1
I presume that this isn't an error because a system header, once upon a
time, probably declared a function improperly.  Wouldn't be the first
time it's happened on SunOS.  Anyway, bombing out and refusing to
generate an object file would be disasterous, especially if you don't
have root access on said machine.
Dave






More information about the Submit mailing list