ARPA-SIMC / meteosatlib

OpenMTP/HRI/HRIT C++ access libraries, gdal drivers and other tools
GNU General Public License v2.0
8 stars 2 forks source link

error compiling on Fedora 28 #9

Closed brancomat closed 5 years ago

brancomat commented 6 years ago

internal test server available (makerpm@ventotto)

/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H   -I.. -I.. -Werror -I/usr/include/gdal   -I/usr/include/gdal   -I/usr/include/gdal  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection  -Wall -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c -o xrit/libmsatdrv_la-dataset.lo `test -f 'xrit/dataset.cpp' || echo './'`xrit/dataset.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I.. -I.. -Werror -I/usr/include/gdal -I/usr/include/gdal -I/usr/include/gdal -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wall -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c xrit/dataset.cpp  -fPIC -DPIC -o xrit/.libs/libmsatdrv_la-dataset.o
xrit/dataset.cpp: In member function 'virtual bool msat::xrit::XRITDataset::init()':
xrit/dataset.cpp:61:23: error: '%02d' directive output may be truncated writing between 2 and 11 bytes into a region of size between 8 and 15 [-Werror=format-truncation=]
     snprintf(buf, 20, "%04d-%02d-%02d %02d:%02d:00", tmtime->tm_year+1900, tmtime->tm_mon+1, tmtime->tm_mday, tmtime->tm_hour, tmtime->tm_min);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xrit/dataset.cpp:61:23: note: directive argument in the range [-2147483647, 2147483647]
In file included from /usr/include/stdio.h:862,
                 from /usr/include/gdal/cpl_port.h:137,
                 from /usr/include/gdal/gdal.h:42,
                 from /usr/include/gdal/gdal_priv.h:60,
                 from ../msat/gdal/clean_gdal_priv.h:4,
                 from ../msat/gdal/dataset.h:23,
                 from xrit/dataset.cpp:2:
/usr/include/bits/stdio2.h:64:35: note: '__builtin___snprintf_chk' output between 20 and 63 bytes into a destination of size 20
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [Makefile:743: xrit/libmsatdrv_la-dataset.lo] Error 1
brancomat commented 5 years ago

this error doesn't show up anymore (?)