cvs commit: src/sys/i386/i386 identcpu.c

Bruce Evans bde at zeta.org.au
Thu May 1 05:14:58 PDT 2003


On Wed, 30 Apr 2003, Mike Barcroft wrote:

> Mark Murray <markm at FreeBSD.org> writes:
> > markm       2003/04/30 05:23:58 PDT
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     sys/i386/i386        identcpu.c
> >   Log:
> >   Warns fixing. Protect against inappropriate linting, and mark
> >   GCC-specific assemble code as such (in #ifdefs). Fix an easy
> >   static variable warning while I'm here.
> >
> >   Revision  Changes    Path
> >   1.122     +8 -1      src/sys/i386/i386/identcpu.c
>
> Is it really useful to #ifdef critical sections of code.  This thing
> isn't going to compile without asm extentions from the compiler.  So
> really you just turn compile errors into link error.  Not very helpful
> IMO.

It's only a link error if the functions (interrupt handlers actually)
written in asm aren't implemented externally (as they aren't :-).  Since
the functions can't be written in C, they should be implemented
externally if portability is a requirement -- it's not just lint that
requires this.

This change depends on the functions being bogusly implicitly declared
extern although they were already actually static in the __GNUC__ case.
If they were declared static to match their implementation in the __GNUC__
case, then both non-gcc compilers would fail before link time.

> Also, you added an used #else clause near the top.
                    ^un

Also, the associated #if-#endif clause is just wrong.  It unprotects
against inappropriate linting (namely, linting of misconfigurations with
no xxx_CPU defined -- this configuration shouldn't work with lint any
more than it does for compilers) and adds some style bugs.

Bruce


More information about the cvs-src mailing list