This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] have -Wformat-overflow handle -fexec-charset (PR 80503)
- From: Martin Sebor <msebor at gmail dot com>
- To: Renlin Li <renlin dot li at foss dot arm dot com>, Christophe Lyon <christophe dot lyon at linaro dot org>
- Cc: Andreas Schwab <schwab at linux-m68k dot org>, Jeff Law <law at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 4 Jun 2017 16:24:49 -0600
- Subject: Re: [PATCH] have -Wformat-overflow handle -fexec-charset (PR 80503)
- Authentication-results: sourceware.org; auth=none
- References: <055b63b9-2303-6031-021c-c216e94ed072@gmail.com> <alpine.DEB.2.20.1704262224580.2840@digraph.polyomino.org.uk> <20170426223418.GV1809@tucnak> <7b8f6999-942c-1540-c6e6-a6284d57baf5@gmail.com> <d85393f5-bbf5-4898-579a-7b9c2ba8a624@redhat.com> <263b8441-72dd-0bb2-39ba-cfa3e820fddf@gmail.com> <877f236qt4.fsf@linux-m68k.org> <CAKdteOYYkH+TK7seTq_1A_DRFv-DMnrNH2V6My+x3phx2gYz5Q@mail.gmail.com> <28dc348f-054d-1b1b-6600-2b3f048ebaf2@gmail.com> <CAKdteObOFzUWi5MczPvdo35rU1WTLWQf9dVW62LNNotqur6gmA@mail.gmail.com> <59318660.4090401@foss.arm.com>
On 06/02/2017 09:38 AM, Renlin Li wrote:
Hi Martin,
After r247444, I saw the following two regressions in
arm-linux-gnueabihf environment:
FAIL: gcc.dg/tree-ssa/builtin-sprintf-warn-18.c (test for warnings,
line 119)
PASS: gcc.dg/tree-ssa/builtin-sprintf-warn-18.c (test for warnings,
line 121)
FAIL: gcc.dg/tree-ssa/builtin-sprintf-warn-18.c (test for warnings,
line 121)
The warning message related to those two lines are:
testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-18.c:119:3: warning:
'%9223372036854775808i' directive width out of range [-Wformat-overflow=]
testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-18.c:121:3: warning:
'%.9223372036854775808i' directive precision out of range
[-Wformat-overflow=]
testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-18.c:121:3: warning:
'%.9223372036854775808i' directive precision out of range
[-Wformat-overflow=]
Did you notice similar things from your test environment, Christophe?
Looks like you're missing a couple of warnings. I see the following
output with both my arm-linux-gnueabihf cross compiler and my native
x86_64 GCC, both in 32-bit and 64-bit modes, as expected by the test,
so I don't see the same issue in my environment.
/ssd/src/gcc/git/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-18.c:119:3:
warning: ‘%9223372036854775808i’ directive width out of range
[-Wformat-overflow=]
T ("%9223372036854775808i", 0); /* { dg-warning "width out of
range" } */
^
/ssd/src/gcc/git/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-18.c:119:3:
warning: ‘%9223372036854775808i’ directive output of 9223372036854775807
bytes causes result to exceed ‘INT_MAX’ [-Wformat-overflow=]
/ssd/src/gcc/git/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-18.c:121:3:
warning: ‘%.9223372036854775808i’ directive precision out of range
[-Wformat-overflow=]
T ("%.9223372036854775808i", 0); /* { dg-warning "precision out of
range" } */
^
/ssd/src/gcc/git/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-18.c:121:3:
warning: ‘%.9223372036854775808i’ directive output of
9223372036854775807 bytes causes result to exceed ‘INT_MAX’
[-Wformat-overflow=]
Martin