This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, testsuite] Remove static from __stack_chk_fail in gcc.dg/ssp-1.c


As I reported in my MIPS -fstack-protector patch this test is failing on MIPS.

__stack_chk_fail is an internal function to the GCC runtime (libssp), however,
the tests ssp-1.c and ssp-2.c redefine it as a way to signal the outcome of
the tests.

In ssp-1.c the function is defined static while in
default_hidden_stack_protect_fail it is declared global.  This is not valid C;
a static declaration cannot follow a non-static but this being an internal
function we don't diagnose in pushdecl.

The patch below removes the static (in ssp-2.c the function in non-static).
The test now passes (together with MIPS -fstack-protector patch) and does not
regress on x86_64-linux either.

OK?

Adam

	* gcc.dg/ssp-1.c (__stack_chk_fail): Remove static.

Index: ssp-1.c
===================================================================
--- ssp-1.c	(revision 146303)
+++ ssp-1.c	(working copy)
@@ -4,7 +4,7 @@
 
 #include <stdlib.h>
 
-static void
+void
 __stack_chk_fail (void)
 {
   exit (0); /* pass */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]