https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83656
Bug ID: 83656
Summary: missing -Wbuiltin-declaration-mismatch on declaration
without prototype
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
G++ issues a -Wbuiltin-declaration-mismatch for the memcpy declaration in the
test case below but GCC does not. Since -Wstrict-prototypes is disabled by
default even in pedantic mode (see bug 82922) this makes it easy to overlook
such declarations in source code and miss invalid calls to them as in the
following test case:
$ cat d.c && gcc -O2 -S -Wall -Wextra -Wpedantic d.c
#if __cplusplus
extern "C" void* memcpy (...);
#else
void* memcpy ();
#endif
void f (char *d)
{
memcpy (3, d, "123");
}