From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 Description of problem: cproto creates output which produces during compilation an error Version-Release number of selected component (if applicable): cproto-4.6-16 How reproducible: Always Steps to Reproduce: 1. Take the following code: #include <stdio.h> /* unix header */ #include <stdlib.h> int BacsGlobalErrorCode; char BacsGlobalErrorMessage[BUFSIZ]; const char *BacsGetErrorMsg (void) /* return error message */ { switch (BacsGlobalErrorCode) { case 1: case 2: case 3: return (BacsGlobalErrorMessage); default: return ("unknown"); } } 2. execute cproto Test.c > Test.h 3. Compile together with the file: #include <stdio.h> /* unix header */ #include <stdlib.h> #include "Test.h" int main(int argc,char **argv) { printf("%s\n",BacsGetErrorMsg); return 0; } 4. compile with: cc -o Test main.c Test.c 5 resulting error: In file included from main.c:4: Test.h:2: function `BacsGetErrorMsg' is initialized like a variable Test.h:2: invalid initializer Test.h:2: (near initialization for `BacsGetErrorMsg') Actual Results: Test.h is: /* Test.c */ const char *BacsGetErrorMsg(void) = {0}; Expected Results: Test.h should look like: /* Test.c */ const char *BacsGetErrorMsg(void); Additional info:
Gunter, I reproduced this bug with cproto-4.6-17. This strange fashion of prototype declaration is fixed in cproto-4.7c-1 (first occured in FC2). I'll keep you informed about cproto fixes in RHEL3. Jindrich
I forgot to thank you for the bug report!
Gunter, this is now fixed rawhide in cproto-4.7c-3.