public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: gcc-patches@gcc.gnu.org
Subject: [testsuite] Fix gcc.dg/torture/pr47917.c on Tru64 UNIX V5.1
Date: Mon, 11 Apr 2011 18:20:00 -0000	[thread overview]
Message-ID: <ydd1v18zm44.fsf@manam.CeBiTec.Uni-Bielefeld.DE> (raw)

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

                 reply	other threads:[~2011-04-11 18:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ydd1v18zm44.fsf@manam.CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).