Patchwork Avoid gcc.dg/tree-prof/val-prof-7.c dependence on <strings.h>

login
register
mail settings
Submitter Joseph S. Myers
Date Oct. 19, 2011, 11:25 p.m.
Message ID <Pine.LNX.4.64.1110192324150.9439@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/120706/
State New
Headers show

Comments

Joseph S. Myers - Oct. 19, 2011, 11:25 p.m.
The testcase gcc.dg/tree-prof/val-prof-7.c includes <strings.h> to get
a declaration of bzero.  This causes it to fail on targets where bzero
(a legacy function removed in the latest version of POSIX) is not
declared in that header; declaring it explicitly in the testcase is
more reliable.  This patch changes the include to an explicit
declaration.

Tested with cross to i686-mingw32 (where the header just includes
<string.h> and does not provide a declaration of bzero).  OK to
commit?

2011-10-19  Joseph Myers  <joseph@codesourcery.com>

	* gcc.dg/tree-prof/val-prof-7.c: Declare bzero instead of
	including <strings.h>.
Richard Guenther - Oct. 20, 2011, 8:15 a.m.
On Thu, Oct 20, 2011 at 1:25 AM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> The testcase gcc.dg/tree-prof/val-prof-7.c includes <strings.h> to get
> a declaration of bzero.  This causes it to fail on targets where bzero
> (a legacy function removed in the latest version of POSIX) is not
> declared in that header; declaring it explicitly in the testcase is
> more reliable.  This patch changes the include to an explicit
> declaration.
>
> Tested with cross to i686-mingw32 (where the header just includes
> <string.h> and does not provide a declaration of bzero).  OK to
> commit?

Ok.

Thanks,
Richard.

> 2011-10-19  Joseph Myers  <joseph@codesourcery.com>
>
>        * gcc.dg/tree-prof/val-prof-7.c: Declare bzero instead of
>        including <strings.h>.
>
> Index: gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c (revision 180200)
> +++ gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c (working copy)
> @@ -1,7 +1,7 @@
>  /* { dg-options "-O2 -fdump-ipa-profile -mtune=core2" } */
>  /* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
>
> -#include <strings.h>
> +extern void bzero (void *, __SIZE_TYPE__);
>
>  int foo(int len)
>  {
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
>

Patch

Index: gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c	(revision 180200)
+++ gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c	(working copy)
@@ -1,7 +1,7 @@ 
 /* { dg-options "-O2 -fdump-ipa-profile -mtune=core2" } */
 /* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
 
-#include <strings.h>
+extern void bzero (void *, __SIZE_TYPE__);
 
 int foo(int len)
 {