This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C bug? in 2.95.1
- To: gcc-bugs at gcc dot gnu dot org
- Subject: C bug? in 2.95.1
- From: JDonner <jdonner at schedsys dot com>
- Date: Tue, 14 Sep 1999 21:56:59 +0000
The following compiles fine, the 'declaration' of Unknown in
SomeStruct seems to allow UserOfUnknown to use it. But shouldn't
that declaration disappear outside the struct?
Or if C just blindly accepts pointers to structs shouldn't it work
within a function, too? UserOfUnknown gets an error without
the decl. within SomeStruct.
Thanks,
Jeff
------------------------------------
/* bug.c */
struct SomeStruct
{
int a;
struct Unknown* pUnknown;
};
extern void UserOfUnknown(struct Unknown* pUnknown);
int main()
{
return 0;
}
I used
gcc -Wall -pedantic -ansi bug.c
gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.1/specs
gcc version 2.95.1 19990816 (release)