rsyslog / liblognorm

a fast samples-based log normalization library
http://www.liblognorm.com
GNU Lesser General Public License v2.1
99 stars 64 forks source link

liblognorm.h:262:8: error: expected identifier or ‘(’ before ‘__extension__’ #204

Closed beave closed 8 years ago

beave commented 8 years ago

I'm in the process of getting Sagan to work with the latest liblognorm & libfastjson. On a fresh Debian 8 system after successful installation of liblognorm, I get the following error:

---- gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I/usr/local/include/libfastjson -I/usr/local/include -g -O2 -MT sagan-sagan-config.o -MD -MP -MF .deps/sagan-sagan-config.Tpo -c -o sagan-sagan-config.o test -f 'sagan-config.c' || echo './'sagan-config.c In file included from /usr/include/string.h:635:0, from sagan-config.c:40: /usr/local/include/liblognorm.h:262:8: error: expected identifier or ‘(’ before ‘extension’ char * strndup(const char *s, size_t n); ----

The code in question is:

----

ifndef HAVE_STRNDUP

char * strndup(const char *s, size_t n);

endif

----

If I comment this section out, the compile continues on successfully.

Please let me know your thoughts.

beave commented 8 years ago

I should not, the error comes up when compiling Sagan with the new liblognorm. Liblognorm compiles fine. Thank you.

davidelang commented 8 years ago

You should probably move sagen to using libfastjson to use the most current liblognorm. There's been work to make it so that the APIs don't conflict, but you are going to be the guinea pig on this as the first external user of libfastjson.

beave commented 8 years ago

Thank you David for the response.

I've already moved Sagan to using the latest liblognorm and libfastjson as of yesterday. The system I was using for testing doesnt have libjson-c install (nor has it ever had it installed). This is a completely clean Debian 8 install.

To get around the compile time issue, I've simply commented out this line.

ifndef HAVE_STRNDUP

char * strndup(const char *s, size_t n);

endif

Other than this compile time issue, Sagan seems to be running fine with the new liblognorm/libfastjson.

Let me know if you have any questions.

rgerhards commented 8 years ago

Note that libfastjson 0.99.2 was kind of an emergency release, as I needed to fix that segfault induced by json-c. However, everything should work fine with that version. Just note that I am working on a much better release of libfastjson, which hopefully will be finished in the not so distant future ;-).