RE: -Wstringop-overflow complains about pointers holding explicitly set addresses

2022-03-16 Thread Guy Benyei via Gcc
Oh, Sorry I've missed that. Thanks Guy

Re: -Wstringop-overflow complains about pointers holding explicitly set addresses

2022-03-16 Thread Andrew Pinski via Gcc
On Wed, Mar 16, 2022 at 1:42 AM Guy Benyei via Gcc wrote: > > Hello all, > Compiling for RISC-V, I've ran into an error like this: > > tmp.c:15:3: error: 'memcpy' writing 4 bytes into a region of size 0 overflows > the destination [-Werror=stringop-overflow=] >15 | memcpy(&str2->c, &str1->c

-Wstringop-overflow complains about pointers holding explicitly set addresses

2022-03-16 Thread Guy Benyei via Gcc
Hello all, Compiling for RISC-V, I've ran into an error like this: tmp.c:15:3: error: 'memcpy' writing 4 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=] 15 | memcpy(&str2->c, &str1->c, sizeof(str2->c)); | ^~