ex_ncurses
ex_ncurses copied to clipboard
Does not build with gcc 4.8.5 (easy fix)
When compiling on CentOS 7 the follow error occurs:
src/ex_ncurses.c: In function ‘ex_invoke’:
src/ex_ncurses.c:715:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i < sizeof(invoke_funcs) / sizeof(ErlNifFunc); i++) {
^
src/ex_ncurses.c:715:5: note: use option -std=c99 or -std=gnu99 to compile your code
changing this line in the Makefile:
CFLAGS ?= -fPIC -O2 -Wall -Wextra -Wno-unused-parameter
to
CFLAGS ?= -std=c99 -fPIC -O2 -Wall -Wextra -Wno-unused-parameter
resolves the issue
@aseigo Would you mind sending a pull request with this change?
actually, it is "fixed" in master as it no longer does a declaration in the for loop. so what appears to be needed is a new release ...