Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not build with gcc 4.8.5 (easy fix) #14

Open
aseigo opened this issue Aug 6, 2018 · 2 comments
Open

Does not build with gcc 4.8.5 (easy fix) #14

aseigo opened this issue Aug 6, 2018 · 2 comments

Comments

@aseigo
Copy link

aseigo commented Aug 6, 2018

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

@fhunleth
Copy link
Collaborator

fhunleth commented Aug 6, 2018

@aseigo Would you mind sending a pull request with this change?

@aseigo
Copy link
Author

aseigo commented Aug 6, 2018

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 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants