servalproject / serval-dna

The Serval Project's core daemon that implements Distributed Numbering Architecture (DNA), MDP, VoMP, Rhizome, MeshMS, etc.
http://servalproject.org
Other
170 stars 81 forks source link

Build fails due to gnu99 compliance issues #140

Closed syn-tax-err closed 5 years ago

syn-tax-err commented 6 years ago

Building the development branch on Raspbian 8 (Debian 8 fork):

Build fails on compiling conf.c with error: os.h:201:36: error: initializer element is not constant

https://github.com/servalproject/serval-dna/blob/b1fdf380f99dc3926e2fe5f6c0858e1f2bcee2e7/os.h#L201

From similar issues on stackoverflow, it appears that the declaration above is not c99 compliant.

I was able to work around the problem and build successfully by changing the line CC = gcc -std=gnu99 to CC = gcc in the toplevel Makefile, however I realize this is a band-aid solution.

Is there a more elegant solution to this problem?

syn-tax-err commented 5 years ago

Commenting out AC_PROG_CC_C99 in configure.ac before running autoreconf fixes the problem in my environment (see above) with no regressions observed, however it may not be suitable for all build environments. Closing the issue and leaving this here as an incomplete solution. sed -e 's/AC_PROG_CC_C99/dnl AC_PROG_CC_C99/' -i configure.ac