Tencent / rapidjson

A fast JSON parser/generator for C++ with both SAX/DOM style API
http://rapidjson.org/
Other
14.23k stars 3.53k forks source link

CentOS 6 #1196

Open jgallagher59701 opened 6 years ago

jgallagher59701 commented 6 years ago

I'm trying to run the tests on CentOS 6 (an AWS VM) (CentOS release 6.9) with cmake 2.8.12 and gcc 4.4.7. Using make -k I get a number of compilation errors.

Do the tests work on CentOS 6?

Here's the first error:

In file included from /home/centos/rapidjson/example/schemavalidator/schemavalidator.cpp:7:
/home/centos/rapidjson/include/rapidjson/schema.h: In member function ‘bool rapidjson::GenericSchemaValidator<SchemaDocumentType, OutputHandler, StateAllocator>::Key(const typename SchemaDocumentType::SchemaType::EncodingType::Ch*, rapidjson::SizeType, bool) [with SchemaDocumentType = rapidjson::GenericSchemaDocument<rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >, rapidjson::CrtAllocator>, OutputHandler = rapidjson::BaseReaderHandler<rapidjson::UTF8<char>, void>, StateAllocator = rapidjson::CrtAllocator]’:
/home/centos/rapidjson/include/rapidjson/schema.h:897: error: ‘index’ may be used uninitialized in this function
/home/centos/rapidjson/include/rapidjson/schema.h:897: note: ‘index’ was declared here
make[2]: *** [example/CMakeFiles/schemavalidator.dir/schemavalidator/schemavalidator.cpp.o] Error 1
make[1]: *** [example/CMakeFiles/schemavalidator.dir/all] Error 2
make: *** [all] Error 2
[centos@ip-172-31-34-54 build]$ 

Here's my terminal session - I followed the build process from the docs without any special options (cmake .. and make)

Installed:
  cmake.x86_64 0:2.8.12.2-4.el6                                                                     

Dependency Installed:
  libarchive.x86_64 0:2.8.3-7.el6_8                                                                 

Complete!
[centos@ip-172-31-34-54 ~]$ git clone https://github.com/Tencent/rapidjson.git
Initialized empty Git repository in /home/centos/rapidjson/.git/
remote: Counting objects: 19887, done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 19887 (delta 30), reused 24 (delta 16), pack-reused 19841
Receiving objects: 100% (19887/19887), 22.93 MiB | 35.98 MiB/s, done.
Resolving deltas: 100% (14949/14949), done.
[centos@ip-172-31-34-54 ~]$ pd rapidjson/
~/rapidjson ~
[centos@ip-172-31-34-54 rapidjson]$ ls
appveyor.yml    contrib  include_dirs.js    RapidJSONConfig.cmake.in         test
bin             doc      library.json       RapidJSONConfigVersion.cmake.in  thirdparty
CHANGELOG.md    docker   license.txt        RapidJSON.pc.in                  travis-doxygen.sh
CMakeLists.txt  example  package.json       readme.md
CMakeModules    include  rapidjson.autopkg  readme.zh-cn.md
[centos@ip-172-31-34-54 rapidjson]$ git submodule update --init
Submodule 'thirdparty/gtest' (https://github.com/google/googletest.git) registered for path 'thirdparty/gtest'
Initialized empty Git repository in /home/centos/rapidjson/thirdparty/gtest/.git/
remote: Counting objects: 10670, done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 10670 (delta 43), reused 64 (delta 35), pack-reused 10580
Receiving objects: 100% (10670/10670), 3.25 MiB, done.
Resolving deltas: 100% (7845/7845), done.
Submodule path 'thirdparty/gtest': checked out '0a439623f75c029912728d80cb7f1b8b48739ca4'
[centos@ip-172-31-34-54 rapidjson]$ mkdir build
[centos@ip-172-31-34-54 rapidjson]$ cd build
[centos@ip-172-31-34-54 build]$ cmake ..
-- The CXX compiler identification is GNU 4.4.7
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- No Doxygen found. Documentation won't be built
-- Found GTestSrc: /home/centos/rapidjson/thirdparty/gtest/googletest  
-- The C compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found PythonInterp: /usr/bin/python (found version "2.6.6") 
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/centos/rapidjson/build
[centos@ip-172-31-34-54 build]$ make
Scanning dependencies of target archivertest
[  1%] Building CXX object example/CMakeFiles/archivertest.dir/archiver/archiver.cpp.o
[  3%] Building CXX object example/CMakeFiles/archivertest.dir/archiver/archivertest.cpp.o
Linking CXX executable ../bin/archivertest
[  3%] Built target archivertest
Scanning dependencies of target capitalize
[  5%] Building CXX object example/CMakeFiles/capitalize.dir/capitalize/capitalize.cpp.o
Linking CXX executable ../bin/capitalize
[  5%] Built target capitalize
Scanning dependencies of target condense
[  7%] Building CXX object example/CMakeFiles/condense.dir/condense/condense.cpp.o
Linking CXX executable ../bin/condense
[  7%] Built target condense
Scanning dependencies of target tutorial
[  9%] Building CXX object example/CMakeFiles/tutorial.dir/tutorial/tutorial.cpp.o
Linking CXX executable ../bin/tutorial
[  9%] Built target tutorial
Scanning dependencies of target filterkeydom
[ 11%] Building CXX object example/CMakeFiles/filterkeydom.dir/filterkeydom/filterkeydom.cpp.o
Linking CXX executable ../bin/filterkeydom
[ 11%] Built target filterkeydom
Scanning dependencies of target filterkey
[ 13%] Building CXX object example/CMakeFiles/filterkey.dir/filterkey/filterkey.cpp.o
Linking CXX executable ../bin/filterkey
[ 13%] Built target filterkey
Scanning dependencies of target jsonx
[ 15%] Building CXX object example/CMakeFiles/jsonx.dir/jsonx/jsonx.cpp.o
Linking CXX executable ../bin/jsonx
[ 15%] Built target jsonx
Scanning dependencies of target lookaheadparser
[ 16%] Building CXX object example/CMakeFiles/lookaheadparser.dir/lookaheadparser/lookaheadparser.cpp.o
Linking CXX executable ../bin/lookaheadparser
[ 16%] Built target lookaheadparser
Scanning dependencies of target messagereader
[ 18%] Building CXX object example/CMakeFiles/messagereader.dir/messagereader/messagereader.cpp.o
Linking CXX executable ../bin/messagereader
[ 18%] Built target messagereader
Scanning dependencies of target parsebyparts
[ 20%] Building CXX object example/CMakeFiles/parsebyparts.dir/parsebyparts/parsebyparts.cpp.o
Linking CXX executable ../bin/parsebyparts
[ 20%] Built target parsebyparts
Scanning dependencies of target pretty
[ 22%] Building CXX object example/CMakeFiles/pretty.dir/pretty/pretty.cpp.o
Linking CXX executable ../bin/pretty
[ 22%] Built target pretty
Scanning dependencies of target prettyauto
[ 24%] Building CXX object example/CMakeFiles/prettyauto.dir/prettyauto/prettyauto.cpp.o
Linking CXX executable ../bin/prettyauto
[ 24%] Built target prettyauto
Scanning dependencies of target schemavalidator
[ 26%] Building CXX object example/CMakeFiles/schemavalidator.dir/schemavalidator/schemavalidator.cpp.o
cc1plus: warnings being treated as errors
In file included from /home/centos/rapidjson/example/schemavalidator/schemavalidator.cpp:7:
/home/centos/rapidjson/include/rapidjson/schema.h: In member function ‘bool rapidjson::GenericSchemaValidator<SchemaDocumentType, OutputHandler, StateAllocator>::Key(const typename SchemaDocumentType::SchemaType::EncodingType::Ch*, rapidjson::SizeType, bool) [with SchemaDocumentType = rapidjson::GenericSchemaDocument<rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >, rapidjson::CrtAllocator>, OutputHandler = rapidjson::BaseReaderHandler<rapidjson::UTF8<char>, void>, StateAllocator = rapidjson::CrtAllocator]’:
/home/centos/rapidjson/include/rapidjson/schema.h:897: error: ‘index’ may be used uninitialized in this function
/home/centos/rapidjson/include/rapidjson/schema.h:897: note: ‘index’ was declared here
make[2]: *** [example/CMakeFiles/schemavalidator.dir/schemavalidator/schemavalidator.cpp.o] Error 1
make[1]: *** [example/CMakeFiles/schemavalidator.dir/all] Error 2
make: *** [all] Error 2
[centos@ip-172-31-34-54 build]$ 
miloyip commented 6 years ago

I think it is a false alarm warning... But it can be fixed by:

        SizeType index = 0;
whatacold commented 5 years ago

This error exists in v1.1.0 too, so any schedule for next release? It's been more than two years since v1.1.0.