ka@PLOVER.CS.WASHINGTON.EDU (Kenneth Almquist) (01/22/89)
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