cvs commit: src/sys/net rtsock.c src/sys/netproto/atalk at_proto.c src/sys/netproto/ipx ipx_proto.c src/sys/netproto/natm natm_proto.c

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Mon Oct 23 15:20:12 PDT 2006


Matthew Dillon wrote:
:
:Joerg Sonnenberger wrote:
:> It should be enough and
:> correct to remove the extern (or declar it static there as well).
:
:The former gives an error (which is what confused me initially) while 
:s/extern/static/ will work (see my commit from ~15min. ago).
:
:Sascha

    Hmm.  That works for procedures, but it's a bad idea to
    forward-declare storage declarations because the compiler
    cannot really discern that the first one is meant to be
    a forward declaration.  If GCC does, it's a dangerous
    quirk.
No, that's valid ANSI C.  You are allowed to have as many declarations for the same identifier as you want (section 6.7, sentence 3):

If an identifier has no linkage, there shall be no more than one declaration of the identifier (in a declarator or type specifier) with the same scope and in the same name space, except for tags as specified in 6.7.2.3.

    I see the problem now that you've pointed it out.  I didn't
    notice the circular loop there and I think the only correct
    solution is your original commit (keeping natmdomain as a
    global) :-)
neither gcc34 nor gcc41 have problems with this:

% cat >d.c <<EOF
int i;
int i;
EOF
% cc -Wall -c d.c
%
cheers
 simon
--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
Attachment:
signature.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00011.pgp
Type: application/octet-stream
Size: 252 bytes
Desc: "Description: OpenPGP digital signature"
URL: <http://lists.dragonflybsd.org/pipermail/commits/attachments/20061023/5c313cdc/attachment-0022.obj>


More information about the Commits mailing list