public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/81629] redefined memcpy leads to segmentation fault
[not found] <bug-81629-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-08 6:49 ` pinskia at gcc dot gnu.org
0 siblings, 0 replies; only message in thread
From: pinskia at gcc dot gnu.org @ 2021-08-08 6:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81629
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |9.0
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
In GCC 9+ we produce:
<source>:2:27: warning: conflicting types for built-in function 'memcpy';
expected 'void *(void *, const void *, long unsigned int)'
[-Wbuiltin-declaration-mismatch]
2 | extern unsigned long long memcpy(unsigned long long, unsigned long
long, unsigned long long);
| ^~~~~~
<source>:1:1: note: 'memcpy' is declared in header '<string.h>'
+++ |+#include <string.h>
1 |
And that is because of r9-5637.
Note the C++ front-end was already doing the correct thing and produce in GCC
7+:<source>:2:31: warning: declaration of 'long long unsigned int memcpy(long
long unsigned int, long long unsigned int, long long unsigned int)' conflicts
with built-in declaration 'void* memcpy(void*, const void*, long unsigned int)'
[-Wbuiltin-declaration-mismatch]
extern "C" unsigned long long memcpy(unsigned long long, unsigned long long,
unsigned long long);
^~~~~~
So all fixed.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-08 6:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-81629-4@http.gcc.gnu.org/bugzilla/>
2021-08-08 6:49 ` [Bug c/81629] redefined memcpy leads to segmentation fault pinskia 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).