This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C bug? in 2.95.1


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]