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

            Bug ID: 117376
           Summary: Spammy -Wstringop-overflow output with memcpy
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: qing.zhao at oracle dot com
  Target Milestone: ---

Created attachment 59506
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59506&action=edit
libcares_la-ares_dns_record.i.xz

I initially thought this was to do with Qing's -fdiagnostics-detials patch but
it isn't.

So, this is either a bug report about:
a) this is too verbose and not super useful IMO, or
b) -fdiagnostics-details should try do something here to make it nicer

IMO the output is far too verbose and not particularly insightful.

--

```
$ gcc -c ./record/.libs/libcares_la-ares_dns_record.i -O3 -std=c90
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_record.c:
In function ‘ares_dns_rr_set_addr6’:
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_record.c:1127:3:
warning: writing 16 bytes into a region of size between 1 and 8
[-Wstringop-overflow=]
 1127 |   memcpy(a, addr, sizeof(*a));
      |   ^
In file included from
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/ares_private.h:59,
                 from
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_record.c:26:
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:101:18:
note: destination object ‘addr’ of size 4
  101 |   struct in_addr addr;
      |                  ^~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:142:17:
note: destination object ‘algorithm’ of size 1
  142 |   unsigned char  algorithm;
      |                 ^~~~~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:147:18:
note: destination object ‘key_tag’ of size 2
  147 |   unsigned short key_tag;
      |                  ^~~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:116:16:
note: destination object ‘refresh’ of size 4
  116 |   unsigned int refresh;
      |                ^~~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:118:16:
note: destination object ‘expire’ of size 4
  118 |   unsigned int expire;
      |                ^~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:170:9:
note: destination object ‘replacement’ of size 8
  170 |   char          *replacement;
      |         ^~~~~~~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:114:9:
note: destination object ‘rname’ of size 8
  114 |   char        *rname;
      |         ^~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:146:16:
note: destination object ‘inception’ of size 4
  146 |   unsigned int   inception;
      |                ^~~~~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:198:17:
note: destination object ‘params’ of size 8
  198 |   ares_array_t  *params; /*!< Type is ares_dns_optval_t */
      |                 ^~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:119:16:
note: destination object ‘minimum’ of size 4
  119 |   unsigned int minimum;
      |                ^~~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:117:16:
note: destination object ‘retry’ of size 4
  117 |   unsigned int retry;
      |                ^~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:143:17:
note: destination object ‘labels’ of size 1
  143 |   unsigned char  labels;
      |                 ^~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:148:9:
note: destination object ‘signers_name’ of size 8
  148 |   char          *signers_name;
      |         ^~~~~~~~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:189:17:
note: destination object ‘selector’ of size 1
  189 |   unsigned char  selector;
      |                 ^~~~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:144:16:
note: destination object ‘original_ttl’ of size 4
  144 |   unsigned int   original_ttl;
      |                ^~~~~~~~~~~~
/var/tmp/portage/net-dns/c-ares-1.34.2/work/c-ares-1.34.2/src/lib/record/ares_dns_private.h:115:16:
note: destination object ‘serial’ of size 4
  115 |   unsigned int serial;
      |                ^~~~~~
```

Reply via email to