Article View: gnu.gcc.help
Article #52015Wall option trouble in 2.3.3
From: Lars Balker Rasmussen
Date: Fri, 12 Feb 1993 17:01
Date: Fri, 12 Feb 1993 17:01
73 lines
3399 bytes
3399 bytes
(Hope this you haven't seen this before, but I have news-server trouble.)
Below is program example, and test compiles on two different gcc-versions:
/* test.c .. trivial example of static array declaration */
#define MAX_ARRAY 20
struct value_type
{
char values[8];
};
struct value_type abil_requirement[SKI_TREE_MAX] =
{
{ 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0}
};
/* Just to avoid compiler trouble ;) */
int main()
{
return 0;
}
/* prog end */
local_sun4% gcc -v
Reading specs from /usr/local/gcc/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/specs
gcc version 2.3.3
local_sun4% gcc -ggdb -ansi -Wall -fno-builtin -target sun4 test.c
test.c:20: warning: aggregate has a partly bracketed initializer
test.c:20: warning: aggregate has a partly bracketed initializer
test.c:20: warning: aggregate has a partly bracketed initializer
test.c:20: warning: aggregate has a partly bracketed initializer
test.c:20: warning: aggregate has a partly bracketed initializer
test.c:20: warning: aggregate has a partly bracketed initializer
test.c:20: warning: aggregate has a partly bracketed initializer
test.c:20: warning: aggregate has a partly bracketed initializer
out_of_house_sun4% gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc/2.2.2/specs
gcc version 2.2.2
out_of_house_sun4% gcc -ggdb -ansi -Wall -fno-builtin -target sun4 test.c
<<No stderr output...>>
How does one avoid this warning without abandoning all the good parts of the
-Wall option? That is, what's new about gcc2.3.3 in the warnings-department,
as we were quite content with 2.2.2's. On top of the above inexplicable
example, what about the way 2.3.3 -Wall treats expressions:
if(a = foo()) --should be---> if((a = foo()))
for( ; a = foo(); ) --should be---> for( ; (a = foo()); )
etc. etc.
This is disturbing as we've used it a lot, and seeing K&R has too, it shouldn't
be warranted a warning under -Wall, but rather an extra -W option....
These two, especially the former, are considered annoying by us, and we'd be
most delighted if someone would point us in the right direction to either
cancel these specific checks from -Wall or at the very least cancel the
bracket thing like we did the expression thing. (Ie. conform to whatever
standard gcc expects us to).
/Lars
--
Disclaimer: Any lack of coherrency is caused by lack of sleep. :)
Anything that sounds vaguely coherrent is of course all MHO.
Technical Details
Message-ID:
<1993Feb12.170117.418@daimi.aau.dk>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!ames!haven.umd.edu!darwin.sura.net!newsserver.jvnc.net!gmd.de!Germany.EU.net!mcsun!sunic!dkuug!daimi!gnortShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,d94974aea712aed8,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-02-12 17:27:43 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!ames!haven.umd.edu!darwin.sura.net!newsserver.jvnc.net!gmd.de!Germany.EU.net!mcsun!sunic!dkuug!daimi!gnort From: gnort@daimi.aau.dk (Lars Balker Rasmussen) Subject: Wall option trouble in 2.3.3 Message-ID: <1993Feb12.170117.418@daimi.aau.dk> Originator: gnort@lyon Sender: news@daimi.aau.dk Organization: DAIMI: Computer Science Department, Aarhus University, Denmark Date: Fri, 12 Feb 93 17:01:17 GMT Lines: 73