Closed yetipenguin closed 6 years ago
Program is compiled when running make
Compilation fails: LANG=C_ALL make rm -rf obj rm -rf bin rm -rf release gcc -c -g -o obj/CoreDumpWriter.o src/CoreDumpWriter.c -I ./include -pthread src/CoreDumpWriter.c: In function 'WriteCoreDumpInternal': src/CoreDumpWriter.c:186:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j = 0; j < i; j++){ ^ src/CoreDumpWriter.c:186:9: note: use option -std=c99 or -std=gnu99 to compile your code make: *** [obj/CoreDumpWriter.o] Error 1
gcc --version gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
make --version GNU Make 3.81
The makefile now includes -std=gnu99 after #21 was merged in. That should fix what you're seeing. Retry building off the development branch.
-std=gnu99
Expected behavior
Program is compiled when running make
Actual behavior
Compilation fails: LANG=C_ALL make rm -rf obj rm -rf bin rm -rf release gcc -c -g -o obj/CoreDumpWriter.o src/CoreDumpWriter.c -I ./include -pthread src/CoreDumpWriter.c: In function 'WriteCoreDumpInternal': src/CoreDumpWriter.c:186:9: error: 'for' loop initial declarations are only allowed in C99 mode for(int j = 0; j < i; j++){ ^ src/CoreDumpWriter.c:186:9: note: use option -std=c99 or -std=gnu99 to compile your code make: *** [obj/CoreDumpWriter.o] Error 1
Steps to reproduce the behavior
System information (e.g., distro, kernel version, etc.)
gcc --version gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
make --version GNU Make 3.81