https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118836
Bug ID: 118836
Summary: sso warning dependend on -fno-builtin
Product: gcc
Version: 14.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: george.thopas at gmail dot com
Target Milestone: ---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100920 introduced some logic
to suppress scalar-storage-order warnings when using memcpy/memset/...
However when required to compile with -fno-builtin this won't work and will
still gives scalar-storage-order warnings
Thank you.
example : compiling gcc/testsuite/ gcc.dg/sso-14.c
bash$ gcc -Wall -fno-builtin sso-14.c
sso-14.c: In function 'main':
sso-14.c:51:11: warning: passing argument 1 of 'memset' from incompatible
scalar storage order [-Wscalar-storage-order]
51 | memset (msg1, 0, sizeof (t_s12));
| ^~~~
sso-14.c:52:11: warning: passing argument 1 of 'memcpy' from incompatible
scalar storage order [-Wscalar-storage-order]
52 | memcpy (msg2, &msg1, sizeof (t_s12));
| ^~~~
sso-14.c:53:18: warning: passing argument 1 of 'memcmp' from incompatible
scalar storage order [-Wscalar-storage-order]
53 | same = memcmp (msg1, msg2, sizeof (t_s12));
| ^~~~
sso-14.c:53:24: warning: passing argument 2 of 'memcmp' from incompatible
scalar storage order [-Wscalar-storage-order]
53 | same = memcmp (msg1, msg2, sizeof (t_s12));
| ^~~~
sso-14.c:46:7: warning: variable 'same' set but not used
[-Wunused-but-set-variable]
46 | int same;