Open DavidGriffith opened 3 years ago
In GitLab by @radiomanV on Nov 22, 2020, 16:40
The earlier version of gcc will throw an error if we use constructs like for(int i = 0...)
and the standard is not specified.
Sometimes i tend to use this kind of construction because of c#. I should replace these couples of lines with this kind of construction instead of forcing a C standard. As for the GCC optimization level perhaps we should change it indeed.
In GitLab by @Franck78 on Jul 30, 2022, 08:31
Hello radioman
On my old but not so old opensuse, gcc version 4.8.5 (SUSE Linux) out of the git make:
ihex.c:104:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
srec.c:135:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
tl866iiplus.c:609:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
tl866iiplus.c:617:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
tl866iiplus.c:641:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
tl866iiplus.c:733:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
tl866iiplus.c:928:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
tl866iiplus.c:1027:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
tl866iiplus.c:1031:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
tl866iiplus.c:1033:7: error: ‘for’ loop initial declarations are only allowed in C99 mode
database.c:588:5: warning: missing braces around initializer [-Wmissing-braces]
retry with -std=c99
jedec.c:55:3: warning: implicit declaration of function ‘strncasecmp’ [-Wimplicit-function-declaration]
minipro.c:193:5: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration]
tl866a.c:514:5: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration]
tl866iiplus.c:544:3: error: unknown type name ‘off_t’
retry with -std=gnu99, no errors , some warnings.
Strange you do not have any warnings.
In GitLab by @hgxl64 on Nov 22, 2020, 05:31
Minipro does not build with the provided Makefile. The error is:
Indeed the code uses C constructs that are only available in more recent C standards, but does not announce that to the compiler. I also notice that optimization is turned off which doesn't make much sense to me. I changed the Makefile like so:
Now the program builds (with some warnings though) and works for me (tested reading/writing an ATTiny45). Please consider modifying the Makefile accordingly.
PS: my build environment is Debian 8.11, gcc is version 4.9.2 (Debian 4.9.2-10+deb8u2)