You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.
When building 0.10.0 for Fedora (Rawhide, currently with GCC 10), there is a strncpy warning in xcursor/xcursor.c:
In file included from /usr/include/string.h:495,
from ../xcursor/xcursor.c:30:
In function 'strncpy',
inlined from '_XcursorAddPathElt' at ../xcursor/xcursor.c:657:5,
inlined from '_XcursorBuildFullname' at ../xcursor/xcursor.c:731:5,
inlined from 'XcursorScanTheme' at ../xcursor/xcursor.c:820:13:
/usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' output truncated before terminating nul copying 7 bytes from a string of the same length [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from '_XcursorAddPathElt' at ../xcursor/xcursor.c:657:5,
inlined from '_XcursorBuildFullname' at ../xcursor/xcursor.c:731:5,
inlined from 'xcursor_load_theme' at ../xcursor/xcursor.c:959:10:
/usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' output truncated before terminating nul copying 7 bytes from a string of the same length [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Thanks to -Werror, this aborts the build.
I checked the code around the specified lines, and the \0 is currently added explicitly:
Because this only manifests on one architecture, and the warning is mitigated on the very next line, I'm inclined to blame GCC and consider this a false positive. Nevertheless, if we want to keep -Werror on, the offending code probably have to be changed.
For the time being, I will work around this by disabling the -Werror flag.
The text was updated successfully, but these errors were encountered:
slyon
added a commit
to slyon/wlroots
that referenced
this issue
Mar 3, 2021
Fix false positive stringop-truncation warning/error with GCC 10 on s390x by indicating GCC to explicitly ignore this case, as it is clearly a false positive (NUL is set in the following line).
This allow the compilation to succeed with -Werror on.
Fixes: swaywm#2018
Fix false positive stringop-truncation warning/error with GCC 10 on s390x by indicating GCC to explicitly ignore this case, as it is clearly a false positive (NUL is set in the following line).
This allow the compilation to succeed with -Werror on.
Fixes: #2018
When building
0.10.0
for Fedora (Rawhide, currently with GCC 10), there is astrncpy
warning inxcursor/xcursor.c
:Thanks to
-Werror
, this aborts the build.I checked the code around the specified lines, and the
\0
is currently added explicitly:wlroots/xcursor/xcursor.c
Lines 657 to 658 in f2943bd
Because this only manifests on one architecture, and the warning is mitigated on the very next line, I'm inclined to blame GCC and consider this a false positive. Nevertheless, if we want to keep
-Werror
on, the offending code probably have to be changed.For the time being, I will work around this by disabling the
-Werror
flag.The text was updated successfully, but these errors were encountered: