Bug 38008 - gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c unportable
Summary: gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c unportable
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-04 00:01 UTC by Jack Howarth
Modified: 2010-10-27 17:06 UTC (History)
2 users (show)

See Also:
Host: i686-apple-darwin10
Target: i686-apple-darwin10
Build: i686-apple-darwin10
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Howarth 2008-11-04 00:01:24 UTC
The following test cases now fail on i686-apple-darwin10...

FAIL: gcc.c-torture/execute/builtins/sprintf.c compilation,  -O0                                                                                  
FAIL: gcc.c-torture/execute/builtins/sprintf.c compilation,  -O1                                                                                  
FAIL: gcc.c-torture/execute/builtins/sprintf.c compilation,  -O2                                                                                   FAIL: gcc.c-torture/execute/builtins/sprintf.c compilation,  -O3 - fomit-frame-pointer                                                                                                                               
FAIL: gcc.c-torture/execute/builtins/sprintf.c compilation,  -O3 -g                                                                                FAIL: gcc.c-torture/execute/builtins/sprintf.c compilation,  -Os    

Mike Stump says this is because the call to  sprintf is unportable code. The library is free to define sprintf and when it does this can fail. He suggest we use...

int
(sprintf) (char *buf, const char *fmt, ...)

instead of the current...

int
sprintf (char *buf, const char *fmt, ...)

I can confirm that this change to gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c eliminates the compilation failure under i686-apple-darwin10.
Comment 1 Jack Howarth 2008-11-09 17:28:56 UTC
Patch posted to gcc-patches...

http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00328.html
Comment 2 Janis Johnson 2008-11-12 17:53:48 UTC
Subject: Bug 38008

Author: janis
Date: Wed Nov 12 17:52:24 2008
New Revision: 141795

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141795
Log:
2008-11-12  Jack Howarth  <howarth@bromo.med.uc.edu>

	PR testsuite/38008
	* gcc.c-torture/execute/builtins/lib/sprintf.c: Make
	sprintf call more portable for darwin10.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c

Comment 3 Janis Johnson 2008-11-17 20:20:21 UTC
Fixed by Jack's patch.