This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR38008 make sprintf call more portable
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: Jack Howarth <howarth at bromo dot msbb dot uc dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 Nov 2008 11:34:37 -0800
- Subject: Re: [PATCH] PR38008 make sprintf call more portable
- References: <20081109172715.GA3910@bromo.msbb.uc.edu>
- Reply-to: janis187 at us dot ibm dot com
On Sun, 2008-11-09 at 12:27 -0500, Jack Howarth wrote:
> The following patch fixes the failures in the...
>
> 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
>
> currently observed in gcc trunk on darwin10. These failures appear as
>
> Executing on host: /sw/src/fink.build/gcc44-4.3.999-20081031/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc44-4.3.999-2008
> 1031/darwin_objdir/gcc/ /sw/src/fink.build/gcc44-4.3.999-20081031/gcc-4.4-20081031/gcc/testsuite/gcc.c-torture/execute/buil
> tins/sprintf.c /sw/src/fink.build/gcc44-4.3.999-20081031/gcc-4.4-20081031/gcc/testsuite/gcc.c-torture/execute/builtins/spri
> ntf-lib.c /sw/src/fink.build/gcc44-4.3.999-20081031/gcc-4.4-20081031/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.
> c -w -O0 -lm -o /sw/src/fink.build/gcc44-4.3.999-20081031/darwin_objdir/gcc/testsuite/gcc/sprintf.x0 (timeout = 30
> 0)
> In file included from /sw/src/fink.build/gcc44-4.3.999-20081031/gcc-4.4-20081031/gcc/testsuite/gcc.c-torture/execute/builti
> ns/sprintf-lib.c:1:
> /sw/src/fink.build/gcc44-4.3.999-20081031/gcc-4.4-20081031/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c:7: er
> ror: expected declaration specifiers or '...' before numeric constant
> /sw/src/fink.build/gcc44-4.3.999-20081031/gcc-4.4-20081031/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c:7: er
> ror: expected declaration specifiers or '...' before '__builtin_object_size'
> compiler exited with status 1
> output is:
> In file included from /sw/src/fink.build/gcc44-4.3.999-20081031/gcc-4.4-20081031/gcc/testsuite/gcc.c-torture/execute/builti
> ns/sprintf-lib.c:1:
> /sw/src/fink.build/gcc44-4.3.999-20081031/gcc-4.4-20081031/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c:7: er
> ror: expected declaration specifiers or '...' before numeric constant
> /sw/src/fink.build/gcc44-4.3.999-20081031/gcc-4.4-20081031/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c:7: er
> ror: expected declaration specifiers or '...' before '__builtin_object_size'
>
> Mike Stump at Apple says this is due to the testcase being unportable due to the use of sprintf which
> can be defined in the library. The workaround is to use the attached patch to make the call to sprintf
> more portable. This has been confirmed on darwin10. Okay for gcc trunk?
> Jack
>
> 2008-11-09 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.
OK.
Janis