[Bug 1181882] New: GCC 11: spirv-tools package fails
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882 Bug ID: 1181882 Summary: GCC 11: spirv-tools package fails Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: screening-team-bugs@suse.de Reporter: martin.liska@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- The package fails here: https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:G... due to: [ 18s] In function 'char* strncpy(char*, const char*, size_t)', [ 18s] inlined from 'spv_diagnostic_t* spvDiagnosticCreate(spv_position, const char*)' at /home/abuild/rpmbuild/BUILD/SPIRV-Tools-2020.6/source/diagnostic.cpp:40:10: [ 18s] /usr/include/bits/string_fortified.h:106:34: error: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=] [ 18s] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); [ 18s] | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 18s] /home/abuild/rpmbuild/BUILD/SPIRV-Tools-2020.6/source/diagnostic.cpp: In function 'spv_diagnostic_t* spvDiagnosticCreate(spv_position, const char*)': [ 18s] /home/abuild/rpmbuild/BUILD/SPIRV-Tools-2020.6/source/diagnostic.cpp:31:25: note: length computed here [ 18s] 31 | size_t length = strlen(message) + 1; [ 18s] | ~~~~~~^~~~~~~~~ [ 18s] cc1plus: all warnings being treated as errors -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882
Martin Li��ka
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882#c1
Ismail D��nmez
The package fails here: https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging: Gcc7/spirv-tools/standard/x86_64
due to: [ 18s] In function 'char* strncpy(char*, const char*, size_t)', [ 18s] inlined from 'spv_diagnostic_t* spvDiagnosticCreate(spv_position, const char*)' at /home/abuild/rpmbuild/BUILD/SPIRV-Tools-2020.6/source/diagnostic.cpp:40:10: [ 18s] /usr/include/bits/string_fortified.h:106:34: error: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=] [ 18s] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); [ 18s] | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ 18s] /home/abuild/rpmbuild/BUILD/SPIRV-Tools-2020.6/source/diagnostic.cpp: In function 'spv_diagnostic_t* spvDiagnosticCreate(spv_position, const char*)': [ 18s] /home/abuild/rpmbuild/BUILD/SPIRV-Tools-2020.6/source/diagnostic.cpp:31:25: note: length computed here [ 18s] 31 | size_t length = strlen(message) + 1; [ 18s] | ~~~~~~^~~~~~~~~ [ 18s] cc1plus: all warnings being treated as errors
strncpy works as intended here, this is a gcc bug https://gcc.gnu.org/bugzilla//show_bug.cgi?id=88059 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882#c3
--- Comment #3 from Martin Li��ka
strncpy works as intended here, this is a gcc bug https://gcc.gnu.org/bugzilla//show_bug.cgi?id=88059
Yes, I must admit the warning has quite some false positivies. In this case, length is used both for allocation of dest argument (which is strlen of message + 1). Thank you for the workaround. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882#c4
Martin Li��ka
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882#c5
--- Comment #5 from Ismail D��nmez
strncpy works as intended here, this is a gcc bug https://gcc.gnu.org/bugzilla//show_bug.cgi?id=88059
Yes, I must admit the warning has quite some false positivies. In this case, length is used both for allocation of dest argument (which is strlen of message + 1). Thank you for the workaround.
s/strncpy/strcpy is a bad workaround, though. Removing -Werror should be enough. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882
http://bugzilla.opensuse.org/show_bug.cgi?id=1181882#c7
Jan Engelhardt
participants (1)
-
bugzilla_noreply@suse.com