Bug 24107 - gcc.dg/20050922-1.c relies in stdint.h
Summary: gcc.dg/20050922-1.c relies in stdint.h
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Paul Brook
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: patch
: 25831 (view as bug list)
Depends on: 448
Blocks: 25831
  Show dependency treegraph
 
Reported: 2005-09-28 18:52 UTC by Joseph S. Myers
Modified: 2007-01-09 23:59 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-10-24 02:51:39


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph S. Myers 2005-09-28 18:52:18 UTC
The testcase gcc.dg/20050922-1.c relies on the header stdint.h, which is not
provided by GCC.  This causes it to fail on systems such as
hppa2.0w-hp-hpux11.11 which have inttypes.h but not stdint.h.

The simplest fix would be to define uint32_t locally in the testcase, along the
lines of

#if __INT_MAX__ == 2147483647
typedef unsigned int uint32_t;
#else
typedef unsigned long uint32_t;
#endif

(not tested).
Comment 1 Andrew Pinski 2005-09-28 21:23:31 UTC
I could swore there were other testcases which included stdint.h but there is not.
Anyways, your definition of int32_t is wrong for some targets.
Comment 2 jsm-csl@polyomino.org.uk 2005-09-28 21:29:41 UTC
Subject: Re:  gcc.dg/20050922-1.c relies in stdint.h

On Wed, 28 Sep 2005, pinskia at gcc dot gnu dot org wrote:

> I could swore there were other testcases which included stdint.h but there is not.
> Anyways, your definition of int32_t is wrong for some targets.

It's not meant to be correct everywhere, simply to be more widely 
functional than the present testcase.  You could of course check 
__INT_MAX__, __LONG_MAX__, __SHRT_MAX and __SCHAR_MAX__ and conditionally 
run a trivial program if none of those is correct - what you can't do is 
mark the test UNSUPPORTED based on preprocessor conditionals if a 32-bit 
type is unavailable.

Comment 3 Joseph S. Myers 2005-10-16 19:01:50 UTC
This failure has appeared on 4.0 branch, for hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11, on 20051014.

This bug can be fixed as a testsuite problem without fixing bug 448: the test doesn't intrinsically need the whole of <stdint.h>, just one type which can be approximated if available from the standard type limits.
Comment 4 GCC Commits 2005-10-24 12:55:41 UTC
Subject: Bug 24107

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pbrook@gcc.gnu.org	2005-10-24 12:55:37

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/gcc.dg: 20050922-1.c 

Log message:
	2005-10-24  Paul Brook  <paul@codesourcery.com>
	
	PR 24107
	* gcc.dg/20050922-1.c: Provide definition of uint32_t without using
	stdint.h.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6240&r2=1.6241
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/20050922-1.c.diff?cvsroot=gcc&r1=1.2&r2=1.3

Comment 5 Paul Brook 2005-10-24 13:02:46 UTC
Fixed
Comment 6 Andrew Pinski 2006-08-15 18:43:14 UTC
*** Bug 25831 has been marked as a duplicate of this bug. ***
Comment 7 John David Anglin 2007-01-09 23:59:30 UTC
I still see this with 4.0.4.
Comment 8 John David Anglin 2007-01-14 17:25:22 UTC
Subject: Bug 24107

Author: danglin
Date: Sun Jan 14 17:25:05 2007
New Revision: 120776

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120776
Log:
	PR testsuite/24107
	Backport from mainline
	2005-10-24  Paul Brook  <paul@codesourcery.com>
	* gcc.dg/20050922-1.c: Provide definition of uint32_t without using
	stdint.h.


Modified:
    branches/gcc-4_0-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_0-branch/gcc/testsuite/gcc.dg/20050922-1.c