Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: format not a string literal and no format arguments #5234

Closed
sagitter opened this issue Apr 25, 2022 · 2 comments
Closed

error: format not a string literal and no format arguments #5234

sagitter opened this issue Apr 25, 2022 · 2 comments
Labels
Milestone

Comments

@sagitter
Copy link

Describe the bug
Code/GraphMol/SubstructLibrary/CMakeFiles/SubstructLibrary.dir/PatternFactory.cpp is not compiled because of format-security error:

[ 97%] Building CXX object Code/GraphMol/SubstructLibrary/CMakeFiles/SubstructLibrary.dir/PatternFactory.cpp.o
cd /home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/redhat-linux-build/Code/GraphMol/SubstructLibrary && /usr/lib64/ccache/g++ -DBOOST_DISABLE_THREADS -DBOOST_SERIALIZATION_DYN_LINK -DRDKIT_DYN_LINK -DRDKIT_SUBSTRUCTLIBRARY_BUILD -DRDK_64BIT_BUILD -DRDK_BUILD_MAEPARSER_SUPPORT -DRDK_HAS_EIGEN3 -DRDK_USE_BOOST_SERIALIZATION -DRDK_USE_STRICT_ROTOR_DEFINITION -DSubstructLibrary_EXPORTS -I/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/External -I/usr/include/inchi -I/usr/include/python3.10 -I/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code -I/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/External/boost-numeric-bindings -isystem /usr/include/eigen3 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mpopcnt -Wno-deprecated -Wno-unused-function -fno-strict-aliasing -Wall -Wextra -fPIC -O2 -g -DNDEBUG -fPIC -std=gnu++14 -MD -MT Code/GraphMol/SubstructLibrary/CMakeFiles/SubstructLibrary.dir/PatternFactory.cpp.o -MF CMakeFiles/SubstructLibrary.dir/PatternFactory.cpp.o.d -o CMakeFiles/SubstructLibrary.dir/PatternFactory.cpp.o -c /home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/GraphMol/SubstructLibrary/PatternFactory.cpp
/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp: In function 'const char* makeMolJSON(CROMol)':
/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp:432:43: warning: unused parameter 'data' [-Wunused-parameter]
  432 | extern "C" const char *makeMolJSON(CROMol data) {
      |                                    ~~~~~~~^~~~
/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp: In function 'void* parseMolJSON(char*, bool)':
/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp:449:38: warning: unused parameter 'data' [-Wunused-parameter]
  449 | extern "C" CROMol parseMolJSON(char *data, bool warnOnFail) {
      |                                ~~~~~~^~~~
/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp:449:49: warning: unused parameter 'warnOnFail' [-Wunused-parameter]
  449 | extern "C" CROMol parseMolJSON(char *data, bool warnOnFail) {
      |                                            ~~~~~^~~~~~~~~~
In file included from /usr/include/pgsql/server/postgres.h:47,
                 from /home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/rdkit.h:41,
                 from /home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp:101:
/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp: In function 'void* MolAdjustQueryProperties(CROMol, const char*)':
/usr/include/pgsql/server/utils/elog.h:215:40: error: format not a string literal and no format arguments [-Werror=format-security]
  215 |         ereport(elevel, errmsg_internal(__VA_ARGS__))
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/pgsql/server/utils/elog.h:128:25: note: in definition of macro 'ereport_domain'
  128 |                         __VA_ARGS__, errfinish(__FILE__, __LINE__, PG_FUNCNAME_MACRO); \
      |                         ^~~~~~~~~~~
/usr/include/pgsql/server/utils/elog.h:215:9: note: in expansion of macro 'ereport'
  215 |         ereport(elevel, errmsg_internal(__VA_ARGS__))
      |         ^~~~~~~
/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp:777:7: note: in expansion of macro 'elog'
  777 |       elog(ERROR, e.what());
      |       ^~~~
/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp: In function 'void* makeAvalonBFP(CROMol, bool, unsigned int)':
/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp:1573:38: warning: unused parameter 'data' [-Wunused-parameter]
 1573 | extern "C" CBfp makeAvalonBFP(CROMol data, bool isQuery,
      |                               ~~~~~~~^~~~
/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp:1573:49: warning: unused parameter 'isQuery' [-Wunused-parameter]
 1573 | extern "C" CBfp makeAvalonBFP(CROMol data, bool isQuery,
      |                                            ~~~~~^~~~~~~
/home/sagitter/rpmbuild/BUILD/rdkit-Release_2022_03_1/Code/PgSQL/rdkit/adapter.cpp:1574:44: warning: unused parameter 'bitFlags' [-Wunused-parameter]
 1574 |                               unsigned int bitFlags) {
      |                               ~~~~~~~~~~~~~^~~~~~~~
cc1plus: some warnings being treated as errors
gmake[2]: *** [Code/PgSQL/rdkit/CMakeFiles/rdkit.dir/build.make:79: Code/PgSQL/rdkit/CMakeFiles/rdkit.dir/adapter.cpp.o] Error 1

To Reproduce
Compiling in Fedora 35 with this CMake command:

+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CFLAGS
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
++ /usr/bin/pg_server_config --includedir-server
+ /usr/bin/cmake -S . -B redhat-linux-build -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON -D RDK_INSTALL_INTREE=OFF -D CMAKE_BUILD_TYPE=RelWithDebInfo -D RDK_BUILD_INCHI_SUPPORT:BOOL=ON -D RDK_BUILD_THREADSAFE_SSS:BOOL=OFF -D RDK_BUILD_CAIRO_SUPPORT:BOOL=ON -D RDK_BUILD_DESCRIPTORS3D:BOOL=OFF -D RDK_BUILD_COORDGEN_SUPPORT:BOOL=OFF -D RDK_BUILD_MOLINTERCHANGE_SUPPORT:BOOL=OFF -D RDK_BUILD_PGSQL:BOOL=ON -D PostgreSQL_ROOT:PATH=/usr -D PostgreSQL_TYPE_INCLUDE_DIR:PATH=/usr/include/pgsql/server -D RDK_PGSQL_STATIC:BOOL=OFF -D RDK_INSTALL_STATIC_LIBS:BOOL=OFF -D RDK_USE_FLEXBISON:BOOL=OFF -D RDK_TEST_MULTITHREADED:BOOL=ON -D PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -D RDK_BOOST_PYTHON3_NAME=python310 -D CATCH_DIR:FILEPATH=/usr/include/catch2 -D RDK_USE_URF:BOOL=OFF -D RDK_INSTALL_COMIC_FONTS:BOOL=OFF -D RDK_BUILD_SWIG_JAVA_WRAPPER:BOOL=OFF -D RDK_BUILD_SWIG_WRAPPERS=OFF

Configuration (please complete the following information):

  • RDKit version: 2022.03.1
  • OS: Fedora 35
  • Python version (if relevant): 3.10
  • Are you using conda? No
@sagitter sagitter added the bug label Apr 25, 2022
@sagitter
Copy link
Author

/usr/include/pgsql/server/utils/elog.h:215:40: error: format not a string literal and no format arguments [-Werror=format-security]

Probably, it's not an issue of RDKIT

greglandrum added a commit to greglandrum/rdkit that referenced this issue Jul 9, 2022
@greglandrum greglandrum added this to the 2022_03_5 milestone Jul 9, 2022
@greglandrum
Copy link
Member

@sagitter It's something we can fix... the PR is now in.
Thanks for reporting this.

greglandrum added a commit that referenced this issue Aug 4, 2022
* Fixes #5234

* update expected output in tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants