[Bug lto/51744] New: Erroneous warning: memset used with constant zero length parameter
richardn26 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Jan 3 20:05:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51744
Bug #: 51744
Summary: Erroneous warning: memset used with constant zero
length parameter
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: lto
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: richardn26@gmail.com
Created attachment 26233
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26233
concatated ma2.i and ma2_test.i from -save-temps ma2.c and ma2_test.c
Attached code gives erroneous warning when compiled with -
gcc -O3 -flto -Wall -Wextra -D_FORTIFY_SOURCE=2 -c ma2.c
gcc -O3 -flto -Wall -Wextra -D_FORTIFY_SOURCE=2 -c ma2_test.c
gcc -O3 -flto -Wall -Wextra -D_FORTIFY_SOURCE=2 -o ma2_test ma2_test.o ma2.o
ma2.o (symbol from plugin): warning: memset used with constant zero length
parameter; this could be due to transposed parameters
Compiling without -flto or without -D_FORTIFY_SOURCE=2 does not give warning.
Generated code seems to work ok anyway.
More information about the Gcc-bugs
mailing list