public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/101854] New: Invalid warning -Wstringop-overflow wrong argument
@ 2021-08-10 23:39 nightstrike at gmail dot com
  2021-08-10 23:44 ` [Bug tree-optimization/101854] " pinskia at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: nightstrike at gmail dot com @ 2021-08-10 23:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854

            Bug ID: 101854
           Summary: Invalid warning -Wstringop-overflow wrong argument
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nightstrike at gmail dot com
  Target Milestone: ---

void f() {
        struct Weird {
                float a; // Comment out any member
                float b; // to silence the warning
                float c;
                float d;
                float e;
        };
        struct Weird g(float const Q[2], float const null[6][8]) {
                return (struct Weird){0};
        }

        float const q[2];
        struct Weird ss = g(q, (void *)0);
}

$ gcc -c a.c
a.c: In function 'f':
a.c:14:27: warning: 'g' accessing 192 bytes in a region of size 8
[-Wstringop-overflow=]
   14 |         struct Weird ss = g(q, (void *)0);
      |                           ^~~~~~~~~~~~~~~
a.c:14:27: note: referencing argument 2 of type 'const float (*)[8]'
a.c:9:22: note: in a call to function 'g'
    9 |         struct Weird g(float const Q[2], float const null[6][8]) {
      |                      ^


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/tmp/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../src/gcc-11.2.0/configure --disable-nls --disable-multilib
--enable-languages=all --prefix=/tmp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.0 (GCC)

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-05-29 10:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 23:39 [Bug c/101854] New: Invalid warning -Wstringop-overflow wrong argument nightstrike at gmail dot com
2021-08-10 23:44 ` [Bug tree-optimization/101854] " pinskia at gcc dot gnu.org
2021-08-10 23:45 ` [Bug c/101854] " nightstrike at gmail dot com
2021-08-10 23:48 ` [Bug tree-optimization/101854] " pinskia at gcc dot gnu.org
2021-08-10 23:50 ` nightstrike at gmail dot com
2021-08-10 23:51 ` pinskia at gcc dot gnu.org
2021-08-10 23:56 ` [Bug tree-optimization/101854] [11/12 Regression] " pinskia at gcc dot gnu.org
2021-08-10 23:58 ` pinskia at gcc dot gnu.org
2021-08-12 22:30 ` msebor at gcc dot gnu.org
2021-08-12 22:30 ` msebor at gcc dot gnu.org
2021-08-17 20:51 ` cvs-commit at gcc dot gnu.org
2021-08-17 20:53 ` [Bug tree-optimization/101854] [11 " msebor at gcc dot gnu.org
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2022-12-22  2:49 ` nightstrike at gmail dot com
2023-05-29 10:05 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).