Commit 2366bf60 by Iain Sandoe Committed by Iain Sandoe

[Darwin, testsuite] Fix Wnonnull on Darwin.

Darwin does not mark entries in string.h with nonnull attributes
so the test fails.  Since the purpose of the test is to check that
the warnings are issued for an inlined function, not that the target
headers are marked up, we can provide marked up headers for Darwin.

gcc/testsuite/ChangeLog:

2019-10-19  Iain Sandoe  <iain@sandoe.co.uk>

	* gcc.dg/Wnonnull.c: Add attributed function declarations for
	memcpy and strlen for Darwin.

From-SVN: r277202
parent dc7e9feb
2019-10-19 Iain Sandoe <iain@sandoe.co.uk>
* gcc.dg/Wnonnull.c: Add attributed function declarations for
memcpy and strlen for Darwin.
2019-10-18 Martin Sebor <msebor@redhat.com> 2019-10-18 Martin Sebor <msebor@redhat.com>
PR tree-optimization/92157 PR tree-optimization/92157
......
...@@ -2,7 +2,16 @@ ...@@ -2,7 +2,16 @@
{ dg-do compile } { dg-do compile }
{ dg-options "-O2 -Wall" } */ { dg-options "-O2 -Wall" } */
#ifndef __APPLE__
#include <string.h> #include <string.h>
#else
/* OSX headers do not mark up the nonnull elements yet. */
# include <stddef.h>
extern size_t strlen (const char *__s)
__attribute ((pure)) __attribute ((nonnull (1)));
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
size_t __n) __attribute ((nonnull (1, 2)));
#endif
char buf[100]; char buf[100];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment