Bizzarre GCC/Unixlib problem
David Gee (1833) 268 posts |
As part of developing a program in C to process an error listing and generate appropriate error messages, I encountered what seems to be a bug in Unixlib (GCC 4.1.2, RO 5.19, Raspberry Pi). Given the following test file contents: lout file "test-err": 16,1: symbol @GP unknown or misspelt and the following code to process it: int main(int argc, char** argv) { FILE *f; /* input file */ char buffer[132]; /* buffer to read line into */ int line; /* line number */ f=fopen(argv[1],"r"); fgets(buffer,132,f); printf("Entering while loop\n"); while (!feof(f)) { line=atoi(buffer); printf("%d : %s\n",line,buffer); fgets(buffer,132,f); } } it works as intended when compiled under gcc with If you’re interested, you can find a .zip file containing all three versions of the program (called testdynamic, teststatic and testscl) together with the relevant data file here |
Ronald May (387) 407 posts |
Same result here using GCC 4.1.2 on Iyonix. I think shows that it is fgets() that is failing.It would be worth reporting this on the GCCSDK mailing list, where the maintainers will see it. |