Article View: gnu.gcc.bug
Article #2185Gcc 1.30 bugs
From: Kenneth Almquist
Date: Sun, 22 Jan 1989 01:15
Date: Sun, 22 Jan 1989 01:15
83 lines
2193 bytes
2193 bytes
BUG 1:
Gcc 1.30 dies without printing an error message when it encounters
certain syntax errors in global declarations.
Reproduce by:
Compile the following code with the -S option:
int x;
volitile int y;
int z;
The .s file produced is:
#NO_APP
.comm _x,4
Note that the first token of the second line of the input file is
an identifier, not a keyword. Correcting the spelling to "volatile"
causes the compiler to generate code for all three declarations.
BUG 2:
Gcc 1.30 doesn't handle forward references to structure tags in
function prototypes correctly. (I don't have a copy of the draft
standard, but I assume such forward references are legal.)
Reproduce by:
Compile the following code:
int f(struct s *);
struct s {
int i;
};
int f(p)
struct s *p;
{
return p->i;
}
Gcc produces the following error message:
bug2.c: In function f:
bug2.c:9: argument `p' doesn't match function prototype
Placing the function prototype for "f" after the declaration of "s"
rather than before it causes the error message to disappear.
Bug 3:
Gcc 1.30 doesn't understand definitions of static functions within
an inner scope.
Reproduce by:
Compile the following code:
int f() {
static int g(void);
return g();
}
static int g() {
return 5;
}
Gcc produces the following error message:
bug3.c: In function g:
bug3.c:6: warning: `g' was declared `extern' and later `static'
Placing the function prototype for g before the function f rather
than within it causes the error message to disappear.
Despite these problems, it's a great compiler.
Kenneth Almquist
Technical Details
Message-ID:
<8901220115.AA12551@plover.cs.washington.edu>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!PLOVER.CS.WASHINGTON.EDU!kaShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!PLOVER.CS.WASHINGTON.EDU!ka From: ka@PLOVER.CS.WASHINGTON.EDU (Kenneth Almquist) Newsgroups: gnu.gcc.bug Subject: Gcc 1.30 bugs Message-ID: <8901220115.AA12551@plover.cs.washington.edu> Date: 22 Jan 89 01:15:02 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: ka@june.cs.washington.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 83