pret / agbcc

C compiler
104 stars 75 forks source link

Buildscript failing. #65

Closed real-F-00 closed 10 months ago

real-F-00 commented 10 months ago

gengenrtl.c:213:18: error: implicit declaration of function ‘strlen’ [-Werror=implicit-function-declaration]
  213 |            (int) strlen (format) - 1);
      |                  ^~~~~~
gengenrtl.c:213:18: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
gengenrtl.c:213:18: warning: incompatible implicit declaration of built-in function ‘strlen’ [-Wbuiltin-declaration-mismatch]
gengenrtl.c:213:18: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
gengenrtl.c: In function ‘genlegend’:
gengenrtl.c:230:6: error: unknown type name ‘FILE’
  230 |      FILE *f;
      |      ^~~~
gengenrtl.c:230:6: note: ‘FILE’ is defined in header ‘<stdio.h>’; did you forget to ‘#include <stdio.h>’?
gengenrtl.c:232:3: warning: incompatible implicit declaration of built-in function ‘fprintf’ [-Wbuiltin-declaration-mismatch]
  232 |   fprintf (f, "/* Generated automaticaly by the program `gengenrtl'\n");
      |   ^~~~~~~
gengenrtl.c:232:3: note: include ‘<stdio.h>’ or provide a declaration of ‘fprintf’
gengenrtl.c: In function ‘genheader’:
gengenrtl.c:238:6: error: unknown type name ‘FILE’
  238 |      FILE *f;
      |      ^~~~
gengenrtl.c:238:6: note: ‘FILE’ is defined in header ‘<stdio.h>’; did you forget to ‘#include <stdio.h>’?
gengenrtl.c:243:14: error: ‘formats’ undeclared (first use in this function)
  243 |   for (fmt = formats; *fmt; ++fmt)
      |              ^~~~~~~
gengenrtl.c:246:3: warning: incompatible implicit declaration of built-in function ‘fprintf’ [-Wbuiltin-declaration-mismatch]
  246 |   fprintf(f, "\n");
      |   ^~~~~~~
gengenrtl.c:246:3: note: include ‘<stdio.h>’ or provide a declaration of ‘fprintf’
rtl.h:48:28: error: ‘LAST_AND_UNUSED_RTX_CODE’ undeclared (first use in this function)
   48 | #define NUM_RTX_CODE ((int)LAST_AND_UNUSED_RTX_CODE)
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
gengenrtl.c:248:19: note: in expansion of macro ‘NUM_RTX_CODE’
  248 |   for (i = 0; i < NUM_RTX_CODE; i++)
      |                   ^~~~~~~~~~~~
gengenrtl.c:250:27: error: ‘defs’ undeclared (first use in this function)
  250 |       if (special_format (defs[i].format))
      |                           ^~~~
gengenrtl.c: In function ‘gencode’:
gengenrtl.c:258:6: error: unknown type name ‘FILE’
  258 |      FILE *f;
      |      ^~~~
gengenrtl.c:258:6: note: ‘FILE’ is defined in header ‘<stdio.h>’; did you forget to ‘#include <stdio.h>’?
gengenrtl.c:262:3: error: implicit declaration of function ‘fputs’ [-Werror=implicit-function-declaration]
  262 |   fputs ("#include \"config.h\"\n", f);
      |   ^~~~~
gengenrtl.c:262:3: note: include ‘<stdio.h>’ or provide a declaration of ‘fputs’
gengenrtl.c:273:14: error: ‘formats’ undeclared (first use in this function)
  273 |   for (fmt = formats; *fmt; ++fmt)
      |              ^~~~~~~
gengenrtl.c: In function ‘main’:
gengenrtl.c:300:3: error: unknown type name ‘FILE’
  300 |   FILE *f;
      |   ^~~~
gengenrtl.c:300:3: note: ‘FILE’ is defined in header ‘<stdio.h>’; did you forget to ‘#include <stdio.h>’?
gengenrtl.c:303:5: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  303 |     exit (1);
      |     ^~~~
gengenrtl.c:303:5: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
gengenrtl.c:307:7: error: implicit declaration of function ‘fopen’ [-Werror=implicit-function-declaration]
  307 |   f = fopen (argv[1], "w");
      |       ^~~~~
gengenrtl.c:307:7: note: ‘fopen’ is defined in header ‘<stdio.h>’; did you forget to ‘#include <stdio.h>’?
gengenrtl.c:307:5: warning: assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  307 |   f = fopen (argv[1], "w");
      |     ^
gengenrtl.c:310:7: error: implicit declaration of function ‘perror’ [-Werror=implicit-function-declaration]
  310 |       perror(argv[1]);
      |       ^~~~~~
gengenrtl.c:311:7: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  311 |       exit (1);
      |       ^~~~
gengenrtl.c:311:7: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
gengenrtl.c:315:3: error: implicit declaration of function ‘fclose’; did you mean ‘false’? [-Werror=implicit-function-declaration]
  315 |   fclose(f);
      |   ^~~~~~
      |   false
gengenrtl.c:317:5: warning: assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  317 |   f = fopen (argv[2], "w");
      |     ^
gengenrtl.c:321:7: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  321 |       exit (1);
      |       ^~~~
gengenrtl.c:321:7: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
gengenrtl.c:327:3: warning: incompatible implicit declaration of built-in function ‘exit’ [-Wbuiltin-declaration-mismatch]
  327 |   exit (0);
      |   ^~~~
gengenrtl.c:327:3: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
cc1: some warnings being treated as errors
make: *** [Makefile:122: gengenrtl.o] Error 1
make: Leaving directory '/home/f-00/agbcc/gcc'

there are so many more errors, but it's too long

not sure what's going on, i'm running Arch Linux, i tried removing -Werror=implicit-function-declaration from the make file of gcc to no avail, either something is very wrong with my system or something else that i'm missing is not working.

i will provide more details if necessary.

real-F-00 commented 10 months ago

turns out my various .h files where corrupted, a quick reinstall of glibc fixed the issue.