On 11/12/19 10:22 AM, Martin Sebor wrote:
Committed in r278098.
I thought I'd tested the kernel with the patch before and got
no warnings, so having rebuilt it again just now I'm surprised
to see the 16 instances below (7 of which are distinct). I'm
happy to report that none looks like a false positive.
Martin
drivers/input/joystick/analog.c:428:3: warning: ‘snprintf’ argument 4
overlaps destination object ‘<unknown>’ [-Wrestrict]
428 | snprintf(analog->name, sizeof(analog->name), "%s %d-hat",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
429 | analog->name, hweight16(analog->mask & ANALOG_HATS_ALL));
--
drivers/leds/led-class-flash.c:212:9: warning: ‘sprintf’ argument 3
overlaps destination object ‘buf’ [-Wrestrict]
212 | return sprintf(buf, "%s\n", buf);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/led-class-flash.c:189:40: note: destination object
referenced by ‘restrict’-qualified argument 1 was declared here
--
drivers/thunderbolt/xdomain.c:656:9: warning: ‘sprintf’ argument 3
overlaps destination object ‘buf’ [-Wrestrict]
656 | return sprintf(buf, "%s\n", buf);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/thunderbolt/xdomain.c:650:15: note: destination object
referenced by ‘restrict’-qualified argument 1 was declared here
--
./drivers/staging/rtl8723bs/include/osdep_service.h:267:48: warning:
‘snprintf’ argument 4 overlaps destination object ‘thread_name’ [-Wrestrict]
267 | #define rtw_sprintf(buf, size, format, arg...) snprintf(buf,
size, format, ##arg)
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:486:2: note: in expansion
of macro ‘rtw_sprintf’
--
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:9: warning:
‘snprintf’ argument 4 overlaps destination object ‘buf’ [-Wrestrict]
86 | res = snprintf(buf, sizeof(buf), "%s[%d] = %d\n", \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87 | buf, i, stats->sub.name[i]); \
--
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:9: warning:
‘snprintf’ argument 4 overlaps destination object ‘buf’ [-Wrestrict]
86 | res = snprintf(buf, sizeof(buf), "%s[%d] = %d\n", \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87 | buf, i, stats->sub.name[i]); \
--
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:9: warning:
‘snprintf’ argument 4 overlaps destination object ‘buf’ [-Wrestrict]
86 | res = snprintf(buf, sizeof(buf), "%s[%d] = %d\n", \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87 | buf, i, stats->sub.name[i]); \
--
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:9: warning:
‘snprintf’ argument 4 overlaps destination object ‘buf’ [-Wrestrict]
86 | res = snprintf(buf, sizeof(buf), "%s[%d] = %d\n", \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87 | buf, i, stats->sub.name[i]); \
--
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:9: warning:
‘snprintf’ argument 4 overlaps destination object ‘buf’ [-Wrestrict]
86 | res = snprintf(buf, sizeof(buf), "%s[%d] = %d\n", \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87 | buf, i, stats->sub.name[i]); \
--
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:9: warning:
‘snprintf’ argument 4 overlaps destination object ‘buf’ [-Wrestrict]
86 | res = snprintf(buf, sizeof(buf), "%s[%d] = %d\n", \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87 | buf, i, stats->sub.name[i]); \
--
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:9: warning:
‘snprintf’ argument 4 overlaps destination object ‘buf’ [-Wrestrict]
86 | res = snprintf(buf, sizeof(buf), "%s[%d] = %d\n", \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87 | buf, i, stats->sub.name[i]); \
--
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:9: warning:
‘snprintf’ argument 4 overlaps destination object ‘buf’ [-Wrestrict]
86 | res = snprintf(buf, sizeof(buf), "%s[%d] = %d\n", \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87 | buf, i, stats->sub.name[i]); \
--
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:9: warning:
‘snprintf’ argument 4 overlaps destination object ‘buf’ [-Wrestrict]
86 | res = snprintf(buf, sizeof(buf), "%s[%d] = %d\n", \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87 | buf, i, stats->sub.name[i]); \
--
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:9: warning:
‘snprintf’ argument 4 overlaps destination object ‘buf’ [-Wrestrict]
86 | res = snprintf(buf, sizeof(buf), "%s[%d] = %d\n", \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87 | buf, i, stats->sub.name[i]); \
--
drivers/net/wireless/ti/wlcore/boot.c:113:4: warning: ‘snprintf’
argument 4 overlaps destination object ‘min_fw_str’ [-Wrestrict]
113 | snprintf(min_fw_str, sizeof(min_fw_str),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
114 | "%s%u.", min_fw_str, min_ver[i]);
--
drivers/net/wireless/ti/wlcore/boot.c:110:4: warning: ‘snprintf’
argument 4 overlaps destination object ‘min_fw_str’ [-Wrestrict]
110 | snprintf(min_fw_str, sizeof(min_fw_str),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111 | "%s*.", min_fw_str);