new GCC11 error:with mismatched bound
Posted: Sun Feb 18, 2018 5:38 am
Hi,
if you got any solution please tell me
/usr/bin/make install DESTDIR=/builddir/build/BUILDROOT/smplayer-18.2.2-1.fc28.x86_64 'INSTALL=/usr/bin/install -p' PREFIX=/usr DOC_PATH=/usr/share/doc/smplayer
cd webserver && make
make[1]: Entering directory '/builddir/build/BUILD/smplayer-18.2.2/webserver'
cc main.c mongoose.c -o simple_web_server -O2 -W -Wall -Werror -Wno-unused-function -DMG_DISABLE_DAV_AUTH -DMG_ENABLE_HTTP_CGI=0 -DMG_ENABLE_THREADS=0 -pthread
mongoose.c: In function 'mg_send_ssi_file.part.42':
mongoose.c:8370:65: error: '%s' directive output may be truncated writing up to 8191 bytes into a region of size 500 [-Werror=format-truncation=]
snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s", file_name);
^~ ~~~~~~~~~
mongoose.c:8370:5: note: 'snprintf' output between 1 and 8192 bytes into a destination of size 500
snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s", file_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongoose.c:8362:35: error: '%s' directive output may be truncated writing up to 8191 bytes into a region of size 500 [-Werror=format-truncation=]
snprintf(path, sizeof(path), "%s", file_name);
^~ ~~~~~~~~~
mongoose.c:8362:5: note: 'snprintf' output between 1 and 8192 bytes into a destination of size 500
snprintf(path, sizeof(path), "%s", file_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongoose.c:8356:38: error: '%s' directive output may be truncated writing up to 8191 bytes into a region of size 499 [-Werror=format-truncation=]
snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
^~ ~~~~~~~~~
mongoose.c:8356:5: note: 'snprintf' output 2 or more bytes (assuming 8193) into a destination of size 500
snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongoose.c: In function 'mg_resolve_async_opt':
mongoose.c:10791:3: error: 'strncpy' specified bound 1024 equals destination size [-Werror=stringop-truncation]
strncpy(req->name, name, sizeof(req->name));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: Leaving directory '/builddir/build/BUILD/smplayer-18.2.2/webserver'
make[1]: *** [Makefile:20: simple_web_server] Error 1
http://koji.rpmfusion.org/kojifiles/wor ... /build.log
http://koji.rpmfusion.org/koji/taskinfo?taskID=197998
if you got any solution please tell me
/usr/bin/make install DESTDIR=/builddir/build/BUILDROOT/smplayer-18.2.2-1.fc28.x86_64 'INSTALL=/usr/bin/install -p' PREFIX=/usr DOC_PATH=/usr/share/doc/smplayer
cd webserver && make
make[1]: Entering directory '/builddir/build/BUILD/smplayer-18.2.2/webserver'
cc main.c mongoose.c -o simple_web_server -O2 -W -Wall -Werror -Wno-unused-function -DMG_DISABLE_DAV_AUTH -DMG_ENABLE_HTTP_CGI=0 -DMG_ENABLE_THREADS=0 -pthread
mongoose.c: In function 'mg_send_ssi_file.part.42':
mongoose.c:8370:65: error: '%s' directive output may be truncated writing up to 8191 bytes into a region of size 500 [-Werror=format-truncation=]
snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s", file_name);
^~ ~~~~~~~~~
mongoose.c:8370:5: note: 'snprintf' output between 1 and 8192 bytes into a destination of size 500
snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s", file_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongoose.c:8362:35: error: '%s' directive output may be truncated writing up to 8191 bytes into a region of size 500 [-Werror=format-truncation=]
snprintf(path, sizeof(path), "%s", file_name);
^~ ~~~~~~~~~
mongoose.c:8362:5: note: 'snprintf' output between 1 and 8192 bytes into a destination of size 500
snprintf(path, sizeof(path), "%s", file_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongoose.c:8356:38: error: '%s' directive output may be truncated writing up to 8191 bytes into a region of size 499 [-Werror=format-truncation=]
snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
^~ ~~~~~~~~~
mongoose.c:8356:5: note: 'snprintf' output 2 or more bytes (assuming 8193) into a destination of size 500
snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mongoose.c: In function 'mg_resolve_async_opt':
mongoose.c:10791:3: error: 'strncpy' specified bound 1024 equals destination size [-Werror=stringop-truncation]
strncpy(req->name, name, sizeof(req->name));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: Leaving directory '/builddir/build/BUILD/smplayer-18.2.2/webserver'
make[1]: *** [Makefile:20: simple_web_server] Error 1
http://koji.rpmfusion.org/kojifiles/wor ... /build.log
http://koji.rpmfusion.org/koji/taskinfo?taskID=197998