This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/83369] Missing diagnostics during inlining
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Dec 2017 15:42:43 +0000
- Subject: [Bug c/83369] Missing diagnostics during inlining
- Auto-submitted: auto-generated
- References: <bug-83369-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83369
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2017-12-11
CC| |msebor at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.
Now that the warning diagnostic supports the %G directive the warning call can
be adjusted to make use of it to produce the following output. Let me post a
patch with the fix.
In function ‘char* my_strcpy(char*, const char*, size_t)’,
inlined from ‘void test(Test*)’ at pr83369.c:32:18:
pr83369.c:14:24: warning: argument 1 null where non-null expected [-Wnonnull]
size_t len = strlen(src);
~~~~~~^~~~~
In file included from pr83369.c:1:
/usr/include/string.h: In function ‘void test(Test*)’:
/usr/include/string.h:394:15: note: in a call to function ‘size_t strlen(const
char*)’ declared here
extern size_t strlen (const char *__s)
^~~~~~
In function ‘char* my_strcpy(char*, const char*, size_t)’,
inlined from ‘void test(Test*)’ at pr83369.c:32:18:
pr83369.c:16:15: warning: argument 2 null where non-null expected [-Wnonnull]
memcpy(dst, src, len + 1);
~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from pr83369.c:1:
/usr/include/string.h: In function ‘void test(Test*)’:
/usr/include/string.h:42:14: note: in a call to function ‘void* memcpy(void*,
const void*, size_t)’ declared here
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
^~~~~~
In function ‘char* my_strcpy(char*, const char*, size_t)’,
inlined from ‘void test(Test*)’ at pr83369.c:32:18:
pr83369.c:19:15: warning: argument 2 null where non-null expected [-Wnonnull]
memcpy(dst, src, size - 1);
~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from pr83369.c:1:
/usr/include/string.h: In function ‘void test(Test*)’:
/usr/include/string.h:42:14: note: in a call to function ‘void* memcpy(void*,
const void*, size_t)’ declared here
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
^~~~~~