ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-bugs: [Wireshark-bugs] [Bug 10000] Use of VALUE_STRING_ARRAY2_GLOBAL_DEF breaks compil

Date: Fri, 18 Apr 2014 01:50:41 +0000

Comment # 6 on bug 10000 from
Just out of curiosity, I did a little bit more research (pretending to be a
protocol lawyer) :)

Although I haven't gone to the primary source doc (the C spec), I did find a
GNU C bug report which seems reasonable as a "secondary source document" (and
does quote the primary doc).

Apparently 'extern var = init' is valid (C89) but considered "extremely
unidiomatic".

=========
From: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45977

"Bug 45977 - "warning: 'i' initialized and declared 'extern'" is spurious "

...

"This is a coding style warning - the code is valid, but extremely 
unidiomatic for C since "extern" is generally expected to mean that the 
declaration is not providing a definition of the object.  Following static 
by extern, though valid, is also a C feature of doubtful value."

"> Whether or not this is idiomatic usage, or corresponds to what is generally
> expected, is not sufficient grounds for a warning.

That is the whole point of warnings: to diagnose dubious usages that 
cannot be given hard errors because they are formally valid according to 
the standard."

=====

So: bottom line: my change, while technically maybe OK, was "not the right
way".

So, again, my thanks to Guy.

Bill


You are receiving this mail because:
  • You are watching all bug changes.