diff mbox

[testsuite] Fix gcc.dg/fstack-protector-strong.c on Solaris/x86

Message ID ydd38tp502w.fsf@lokon.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth May 14, 2013, 10:26 a.m. UTC
The new gcc.dg/fstack-protector-strong.c testcase is currently failing
on Solaris/x86 like this:

FAIL: gcc.dg/fstack-protector-strong.c (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/fstack-protector-strong.c:113:13: warning: incompatible implicit declaration of built-in function 'alloca' [enabled by default]

Matching other testcases that use alloca, I've fixed it by explicitly
declaring alloca.

Tested with the appropriate runtest invocations on i386-pc-solaris2.11
and x86_64-unknown-linux-gnu, installed on mainline.

	Rainer


2013-05-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.dg/fstack-protector-strong.c (alloca): Declare.

Comments

Jakub Jelinek May 14, 2013, 10:31 a.m. UTC | #1
On Tue, May 14, 2013 at 12:26:31PM +0200, Rainer Orth wrote:
> Tested with the appropriate runtest invocations on i386-pc-solaris2.11
> and x86_64-unknown-linux-gnu, installed on mainline.

I'd say the test should just use __builtin_alloca instead.

> 2013-05-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 
> 	* gcc.dg/fstack-protector-strong.c (alloca): Declare.
> 

> # HG changeset patch
> # Parent 677b6b866a10b42d04929883383fbf70e152c598
>  Fix gcc.dg/fstack-protector-strong.c on Solaris/x86
> 
> diff --git a/gcc/testsuite/gcc.dg/fstack-protector-strong.c b/gcc/testsuite/gcc.dg/fstack-protector-strong.c
> --- a/gcc/testsuite/gcc.dg/fstack-protector-strong.c
> +++ b/gcc/testsuite/gcc.dg/fstack-protector-strong.c
> @@ -6,6 +6,8 @@
>  #include<string.h>
>  #include<stdlib.h>
>  
> +extern void *alloca(__SIZE_TYPE__);
> +
>  extern int g0;
>  extern int* pg0;
>  int

	Jakub
Jeff Law May 14, 2013, 12:59 p.m. UTC | #2
On 05/14/2013 04:31 AM, Jakub Jelinek wrote:
> On Tue, May 14, 2013 at 12:26:31PM +0200, Rainer Orth wrote:
>> Tested with the appropriate runtest invocations on i386-pc-solaris2.11
>> and x86_64-unknown-linux-gnu, installed on mainline.
>
> I'd say the test should just use __builtin_alloca instead.
Yea, let's go with that.  OK with that fix.  I


Ranier, if you run into others, they're pre-approved to be fixed this 
way as well.

jeff
diff mbox

Patch

# HG changeset patch
# Parent 677b6b866a10b42d04929883383fbf70e152c598
 Fix gcc.dg/fstack-protector-strong.c on Solaris/x86

diff --git a/gcc/testsuite/gcc.dg/fstack-protector-strong.c b/gcc/testsuite/gcc.dg/fstack-protector-strong.c
--- a/gcc/testsuite/gcc.dg/fstack-protector-strong.c
+++ b/gcc/testsuite/gcc.dg/fstack-protector-strong.c
@@ -6,6 +6,8 @@ 
 #include<string.h>
 #include<stdlib.h>
 
+extern void *alloca(__SIZE_TYPE__);
+
 extern int g0;
 extern int* pg0;
 int