Build issue with latest (prerelease 7.0) GCC
Steve Ellcey
sellcey@caviumnetworks.com
Tue Jan 31 16:25:00 GMT 2017
I just built the latest glibc with the latest (pre-release) GCC 7.0 and
got this build failure:
../sysdeps/posix/tempname.c: In function â__path_searchâ:
../sysdeps/posix/tempname.c:169:24: error: â%.*sâ directive output between 0 and
 5 bytes may cause result to exceed âINT_MAXâ [-Werror=format-
overflow=]
   sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
                        ^~~~
../sysdeps/posix/tempname.c: In function â__path_searchâ:
../sysdeps/posix/tempname.c:169:24: error: â%.*sâ directive output between 0 and
 5 bytes may cause result to exceed âINT_MAXâ [-Werror=format-
overflow=]
   sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
                        ^~~~
cc1: all warnings being treated as errors
I am not sure if we want a DIAG_PUSH_NEEDS_COMMENT here or if there is
a way to fix the code but I thought I would at least raise the issue
and see if we want to do anything before the code freeze.  I think the
problem only happens with 32 bit builds.  I did not see it in my 64 bit
build.
Steve Ellcey
sellcey@cavium.com
More information about the Libc-alpha
mailing list