This is the mail archive of the gcc-help@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]
Other format: [Raw text]

incompatible function declaration


Hi,

gcc behaves differently for following program:

void foo2();
int main() {
   extern void foo(void);
   foo();
   foo2();
   return 0;
}

void foo2() {
   foo();
}


compilation command: gcc -c t1.c


result:
1. gcc 3.2.2 compiles successfully.

2. gcc 4.0.3 gives following message:

t1.c: In function 'foo2':
t1.c:10: error: incompatible implicit declaration of function 'foo'
t1.c:3: error: previous implicit declaration of 'foo' was here


question: which one is more correct ? Is the error message too severe ?


Regards,


Mike




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