On 11/7/20 1:38 PM, Orion Poplawski wrote: > On 11/7/20 1:26 PM, Steve Dickson wrote: >> Hello, >> >> I'm getting a build failure on the armv7hl arch >> and the i686 arch, which do not make much sense. >> >> The build is [1] and only those arche are complaining about an >> sprintf() statement. >> The rest of the arches are fine with the statment... %99.9 of the arches >> that are used today... I didn't even realize i686 was still supported! >> >> The is the failure: >> conffile.c: In function 'conf_init_dir': >> conffile.c:707:22: error: '%s' directive writing between 6 and >> 2147483645 bytes into a region of size between 4095 and 4096 >> [-Werror=format-overflow=] >> 707 | sprintf(fname, "%s/%s", dname, d->d_name); >> | ^~ >> In file included from /usr/include/stdio.h:866, >> from conffile.c:45: >> /usr/include/bits/stdio2.h:38:10: note: '__sprintf_chk' output 8 or >> more bytes (assuming 2147483648) into a destination of size 4097 >> 38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 39 | __bos (__s), __fmt, __va_arg_pack ()); >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> So I change the sprintf() to an snprintf() [2] guaranteeing no >> overflow and I got the same failure. So it is something esoteric >> about those arches... that I'm missing... >> >> Anybody have clue as to what is going on?? >> >> tia, >> >> steved. > > I think the compiler is trying to keep track of how large string > pointed to by d->d_name could be. You'll need to look into how that > is created. That is precisely what it is doing. > > No idea why snprintf() doesn't help. Likewise. I recommend filing an upstream GCC bug report. Feel free to cc law@xxxxxxxxxx and msebor@xxxxxxxxxx on that upstream bug. jeff _______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx