joyent/libuv — Issue #254: Make failure of gcc caused by "inline static"
Author: shigeki
Created: 2011-11-21 16:22:35+00:00
State: open

On my Ubuntu 11.10 with gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1, making of libuv failes with errors below,

unix:~/tmp/github/libuv> make
cc --std=c89 -pedantic -Wall -Wextra -Wno-unused-parameter -D_GNU_SOURCE -Iinclude -Iinclude/uv-private -Isrc/unix/ev -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Isrc/ares/config_linux -Isrc -g -c src/unix/core.c -o src/unix/core.o
In file included from src/unix/core.c:22:0:
src/unix/internal.h:59:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'static'
src/unix/internal.h:66:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'static'
src/unix/internal.h:79:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'static'
make: *** [src/unix/core.o] Error 1

This may be because "inline static" in src/unix/internal.h is not supported with an option not --std=c89 but -std=gnu89, -std=c99, -std=c1x or -std=gnu99 as described in http://gcc.gnu.org/onlinedocs/gcc/Inline.html but I'm not sure which option is best to compile the current libuv sources.

I've tried and found that with -std=gnu89 and -std=c99 libuv is compiled with no errors in my environment at both cases.

Please change CSTDFLAG=--std=c89 in config-unix.mk into the proper option.