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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Marsh, Chris
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  -DGDAL_COMPILATION -DHAVE_PCRE -DSQLITE_HAS_COLUMN_METADATA -c -o ../o/ogrsqliteexecutesql.lo ogrsqliteexecutesql.cpp
In file included from /cvmfs/<a href="http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c&#43;&#43;/8.3.0/cstdlib:75">soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/cstdlib:75,
                 from /cvmfs/<a href="http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c&#43;&#43;/8.3.0/ext/string_conversions.h:41">soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/ext/string_conversions.h:41,
                 from /cvmfs/<a href="http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c&#43;&#43;/8.3.0/bits/basic_string.h:6400">soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/bits/basic_string.h:6400,
                 from /cvmfs/<a href="http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c&#43;&#43;/8.3.0/string:52">soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/string:52,
                 from /cvmfs/<a href="http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c&#43;&#43;/8.3.0/stdexcept:39">soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/stdexcept:39,
                 from /cvmfs/<a href="http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c&#43;&#43;/8.3.0/array:39">soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/array:39,
                 from /cvmfs/<a href="http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c&#43;&#43;/8.3.0/tuple:39">soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/tuple:39,
                 from /cvmfs/<a href="http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c&#43;&#43;/8.3.0/bits/stl_map.h:63">soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c++/8.3.0/bits/stl_map.h:63,
                 from /cvmfs/<a href="http://soft.computecanada.ca/nix/var/nix/profiles/gcc-8.3.0/include/c&#43;&#43;/8.3.0/map:61">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
      __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'


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDAL compile error: expected initializer before ‘__attribute_alloc_size__’

Even Rouault-2
You didn't actually paste the error message itself, but I guess it must be
'error: expected ‘,’ or ‘;’ before ‘__attribute_alloc_size__’' from hits found
by

https://www.google.com/search?q=__attribute_alloc_size__

This error seems to occur in various other contexts. Perhaps something due to
your particular build chain rather than GDAL itself. Of course if you find a
reasonable fix to upstream in GDAL, that'd be welcome.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDAL compile error: expected initializer before ‘__attribute_alloc_size__’

Marsh, Chris
That's...odd. I don't quite know what happened there, sorry. here is the full error

/cvmfs/soft.computecanada.ca/nix/var/nix/profiles/16.09/include/stdlib.h:471:35: error: expected initializer before ‘__attribute_alloc_size__’
      __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
                                   ^~~~~~~~~~~~~~~~~~~~~~~~

I had seen the 'error: expected ‘,’ or ‘;’ before ‘__attribute_alloc_size__’' posts, but this seems to be different.

I take it then that you've never run into this before?


On Wed, Apr 17, 2019 at 3:26 PM Even Rouault <[hidden email]> wrote:
You didn't actually paste the error message itself, but I guess it must be
'error: expected ‘,’ or ‘;’ before ‘__attribute_alloc_size__’' from hits found
by

https://www.google.com/search?q=__attribute_alloc_size__

This error seems to occur in various other contexts. Perhaps something due to
your particular build chain rather than GDAL itself.    Of course if you find a
reasonable fix to upstream in GDAL, that'd be welcome.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev