https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118877
Bug ID: 118877
Summary: -Wstringop-overread in gcc/attribs.cc with -O3
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: xry111 at gcc dot gnu.org
Target Milestone: ---
/home/xry111/git-repos/gcc-build/./prev-gcc/xg++
-B/home/xry111/git-repos/gcc-build/./prev-gcc/
-B/usr/local/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/home/xry111/git-repos/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/home/xry111/git-repos/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/home/xry111/git-repos/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I/home/xry111/git-repos/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
-I/home/xry111/git-repos/gcc/libstdc++-v3/libsupc++
-L/home/xry111/git-repos/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/xry111/git-repos/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-fno-PIE -c -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND -O3
-fno-checking -gtoggle -DIN_GCC -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Wconditionally-supported
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Werror -DHAVE_CONFIG_H -fno-PIE -I. -I.
-I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include
-I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody
-I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid
-I../libdecnumber -I../../gcc/gcc/../libbacktrace -o attribs.o -MT attribs.o
-MMD -MP -MF ./.deps/attribs.TPo ../../gcc/gcc/attribs.cc
In function ‘void selftest::test_attribute_exclusions()’,
inlined from ‘void selftest::attribs_cc_tests()’ at
../../gcc/gcc/attribs.cc:2761:29:
../../gcc/gcc/attribs.cc:2736:27: error: ‘int strcmp(const char*, const char*)’
reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
2736 | if (!strcmp (attr_name, excl_name))
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In function ‘void selftest::attribs_cc_tests()’:
cc1plus: note: source object is likely at address zero
cc1plus: all warnings being treated as errors
Not sure if the warning is false or not.