public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [testsuite] Fix gcc.dg/torture/pr47917.c on Tru64 UNIX V5.1
@ 2011-04-11 18:20 Rainer Orth
  0 siblings, 0 replies; only message in thread
From: Rainer Orth @ 2011-04-11 18:20 UTC (permalink / raw)
  To: gcc-patches

As on several platforms, gcc.dg/torture/pr47917.c was failing on Tru64
UNIX V5.1.  To get a standards-conformant snprintf (and vsnprintf), one
needs to define _ISO_C_SOURCE=19990L (sic!).  Initially, I tried to
solve the problem in a general way by always defining that macro with
-stdc=c99|gnu99, but that opened a can of worms: if that macro is
defined, many other feature test macros like _XOPEN_SOURCE,
POSIX_SOURCE, _OSF_SOURCE are gone and bootstrap fails all over
(i.e. any target library which depends on C99 features like libgfortran,
libjava, and libstdc++).  The seems to be no way to do this properly, so
I've chosen the easy way out and define the macro just for the single
testcase. 

Tested with the appropriate runtest invocation, installed on mainline.

	Rainer


2011-04-11  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.dg/torture/pr47917.c: Define _ISO_C_SOURCE=19990L for
	alpha*-dec-osf5*.

Index: gcc/testsuite/gcc.dg/torture/pr47917.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr47917.c	(revision 172269)
+++ gcc/testsuite/gcc.dg/torture/pr47917.c	(revision 172270)
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-std=c99" } */
+/* { dg-options "-std=c99 -D_ISO_C_SOURCE=19990L" { target alpha*-dec-osf5* } } */
 /* { dg-options "-std=c99 -D_XOPEN_SOURCE=500" { target mips-sgi-irix6.5 *-*-solaris2.[89] } } */
 /* { dg-options "-std=gnu99" { target *-*-hpux* } } */
 /* { dg-xfail-if "no C99 snprintf function" { *-*-hpux10* } } */
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog	(revision 172269)
+++ gcc/testsuite/ChangeLog	(revision 172270)
@@ -1,3 +1,8 @@
+2011-04-11  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* gcc.dg/torture/pr47917.c: Define _ISO_C_SOURCE=19990L for
+	alpha*-dec-osf5*.
+
 2011-04-11  Martin Jambor  <mjambor@suse.cz>
 
 	PR tree-optimization/48195

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-11 18:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-11 18:20 [testsuite] Fix gcc.dg/torture/pr47917.c on Tru64 UNIX V5.1 Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).