[gdal-dev] GDAL compile error: expected initializer before ‘__attribute_alloc_size__’

Marsh, Chris chris.marsh at usask.ca
Wed Apr 17 14:14:28 PDT 2019


Hi,
I'm trying to build GDAL 2.4.1 with gcc 8.3.0 on a CentOS 7 system. However, I get the below error. Any ideas on how to proceed? This works fine with older gcc, e.g., 5.4

Cheers
Chris


$ uname -a
Linux gra-login3 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 GNU/Linux

configure command:
CXXFLAGS=-DDONT_DEPRECATE_SPRINTF ./configure  --prefix=${CMAKE_BINARY_DIR}/lib/gdal --with-static-proj4=${CMAKE_BINARY_DIR}/lib/proj4 --without-hdf5 --without-netcdf

The error:

bin/sh /home/cmarsh/build-test/lib/GDAL-prefix/src/GDAL/libtool --mode=compile --silent --tag=CXX g++ -I/home/cmarsh/build-test/lib/GDAL-prefix/src/GDAL/port -I/home/cmarsh/build-test/lib/GDAL-prefix/src/GDAL/gcore -I/home/cmarsh/build-test/lib/GDAL-prefix/src/GDAL/alg -I/home/cmarsh/build-test/lib/GDAL-prefix/src/GDAL/ogr -I/home/cmarsh/build-test/lib/GDAL-prefix/src/GDAL/ogr/ogrsf_frmts -I/home/cmarsh/build-test/lib/GDAL-prefix/src/GDAL/gnm -I/home/cmarsh/build-test/lib/GDAL-prefix/src/GDAL/apps -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -DDONT_DEPRECATE_SPRINTF  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wlogical-op -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wduplicated-cond -Wextra-semi -Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wsuggest-override -Wimplicit-fallthrough  -I..  -I/usr/include  -DGNM_ENABLED -I/home/cmarsh/build-test/lib/GDAL-prefix/src/GDAL/port -I/cvmfs/soft.computecanada.ca/nix/store/k8yicfria8gwr06km6qda1mdm9kz1h7r-openjpeg-2.3.0-dev/include/openjpeg-2.3<http://soft.computecanada.ca/nix/store/k8yicfria8gwr06km6qda1mdm9kz1h7r-openjpeg-2.3.0-dev/include/openjpeg-2.3>  -DGDAL_COMPILATION -DHAVE_PCRE -DSQLITE_HAS_COLUMN_METADATA -c -o ../o/ogrsqliteexecutesql.lo ogrsqliteexecutesql.cpp
In file included from /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/cstdlib:75<http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/cstdlib:75>,
                 from /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/ext/string_conversions.h:41<http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/ext/string_conversions.h:41>,
                 from /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/bits/basic_string.h:6400<http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/bits/basic_string.h:6400>,
                 from /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/string:52<http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/string:52>,
                 from /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/stdexcept:39<http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/stdexcept:39>,
                 from /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/array:39<http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/array:39>,
                 from /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/tuple:39<http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/tuple:39>,
                 from /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/bits/stl_map.h:63<http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/bits/stl_map.h:63>,
                 from /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/map:61<http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/map:61>,
                 from ogr_sqlite.h:35,
                 from ogrsqliteexecutesql.cpp:29:
/cvmfs/soft.computecanada.ca/nix/var/nix/profiles/16.09/include/stdlib.h:471:35<http://soft.computecanada.ca/nix/var/nix/profiles/16.09/include/stdlib.h:471:35>:
      __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
                                   ^~~~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [../../../GDALmake.opt:670: ../o/ogrsqliteexecutesql.lo] Error 1
make[3]: Leaving directory '/home/cmarsh/build-test/lib/GDAL-prefix/src/GDAL/ogr/ogrsf_frmts/sqlite'

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20190417/26782daf/attachment.html>


More information about the gdal-dev mailing list