patrickfrey / strus

Library implementing the storage and the query evaluation for a text search engine. It uses on a key value store database interface to store its data. Currently there exists an implementation based on the google LevelDB library.
http://www.project-strus.net
Mozilla Public License 2.0
47 stars 1 forks source link

strus doen't build with older gcc #96

Closed andreasbaumann closed 7 years ago

andreasbaumann commented 7 years ago

gcc is 4.4.7 (Centos 6):

[ 10%] Building CXX object src/storage/CMakeFiles/strus_storage_static.dir/attributeReader.cpp.o
In file included from /home/build/strus/src/storage/storageClient.hpp:12,
                 from /home/build/strus/src/storage/attributeReader.hpp:12,
                 from /home/build/strus/src/storage/attributeReader.cpp:8:
/opt/eurospider/strus/include/strus/numericVariant.hpp: In constructor 'strus::NumericVariant::String::String(const strus::NumericVariant&)':
/opt/eurospider/strus/include/strus/numericVariant.hpp:91: error: expected ')' before 'PRId64'
compilation terminated due to -Wfatal-errors.

There is also a warning:

In file included from /home/build/strus/src/utils/cstring.c:1:
/home/build/strus/include/private/cstring.h:8:1: warning: C++ style comments are not allowed in ISO C90
/home/build/strus/include/private/cstring.h:8:1: warning: (this will be reported only once per input file)
andreasbaumann commented 7 years ago

Missing a #include <inttypes.h>?

andreasbaumann commented 7 years ago

Another idea comes from /usr/include/inttypes.h:

/* The ISO C99 standard specifies that these macros must only be
   defined if explicitly requested.  */
#if !defined __cplusplus || defined __STDC_FORMAT_MACROS
patrickfrey commented 7 years ago

I put a #define __STDC_FORMAT_MACROS before including in numericVariant.hpp Should build now.

andreasbaumann commented 7 years ago

more warnings:

/opt/eurospider/strus/include/strus/numericVariant.hpp: In constructor 'strus::NumericVariant::String::String(const strus::NumericVariant&)':
/opt/eurospider/strus/include/strus/numericVariant.hpp:96: warning: ISO C++ does not support the '%lf' gnu_printf format
/opt/eurospider/strus/include/strus/numericVariant.hpp:96: warning: ISO C++ does not support the '%lf' gnu_printf format
andreasbaumann commented 7 years ago

This is a GNUism and should not be used!

patrickfrey commented 7 years ago

Replaced %lf with %f

andreasbaumann commented 7 years ago

thanks.

what about:

In file included from /home/build/strus/src/utils/cstring.c:1:
/home/build/strus/include/private/cstring.h:8:1: warning: C++ style comments are not allowed in ISO C90
/home/build/strus/include/private/cstring.h:8:1: warning: (this will be reported only once per input file)
andreasbaumann commented 7 years ago

Builds.