mmitch / gbsplay

gameboy sound player
https://mmitch.github.io/gbsplay/
Other
98 stars 20 forks source link

compilation fails after comit 9593e46 #30

Closed cyberic99 closed 4 years ago

cyberic99 commented 4 years ago

Hello Since commit https://github.com/mmitch/gbsplay/commit/9593e466f9e08d3cb40521bcd3a313884c3cbcac, I get an error while compiling: My gcc is a bit old: gcc version 4.9.2 (Debian 4.9.2-10)

I get this error:

CC gbhw.c -o gbhw.o
gbhw.c:85:1: error: initializer element is not constant
 static long vblankctr = vblanktc;
 ^
Makefile:419: recipe for target 'gbhw.o' failed
make: *** [gbhw.o] Error 1

This error is surprising, as vblanktc is declared as:

static const long vblanktc = 70224

Thanks

ranma commented 4 years ago

Works with "gcc (Debian 8.3.0-6) 8.3.0", but may be a bug in the newer gcc mistakenly allowing it. Can you check if it works when you add --std=gnu99 or --std=gnu11 to the configure CFLAGS?

ranma commented 4 years ago

Hmm, actually travis-ci noticed this as well, but I missed it: https://travis-ci.org/mmitch/gbsplay/jobs/616259818?utm_medium=notification&utm_source=github_status $ gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609 CC gbhw.c -o gbhw.o gbhw.c:84:25: error: initializer element is not constant static long vblankctr = vblanktc;