From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8548 invoked by alias); 12 May 2014 15:52:29 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 8485 invoked by uid 48); 12 May 2014 15:52:24 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/39438] Can't compile a wrapper around strftime with -Werror=format-nonliteral Date: Mon, 12 May 2014 15:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.3.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-05/txt/msg01042.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D39438 --- Comment #8 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to D. Hugh Redelmeier from comment #6) > > If you can produce another similar example that works with printf, that= would also help. >=20 > I don't think that printf is similar enough. A strftime format doesn't > interact with varargs in a complex and problematic way. A string, on its > own, is or is not a valid strftime format; a string is only a valid printf > format when considered with the argument list. >=20 > If an arg is marked as a const char * (i.e. unchanging) and has the strft= ime > format attribute, it should be accepted as if it were a literal strftime > argument. After all, the necessary checking would have been done at this > routine's points of call. Assuming that the wrapper is marked with the correct attribute, GCC would n= eed to know that this const char* comes from the correct wrapper's argument. I = am not sure this is trivial to know at the point of warning without additional work/info in the front-end. Some comments above have suggested that this work/info is done for printf, so the first thing someone looking at this sh= ould do is to understand how printf detects this case, and why the same is not d= one for strftime, and then try to share as much code between the two cases as possible. Perhaps it is a bug, perhaps it was never implemented for strftim= e. In any case, one would need to debug GCC using two similar and minimal testcases to understand what is going on. See http://gcc.gnu.org/wiki/DebuggingGCC if you want to see how this works.= As an exercise, try to find the point of warning while debugging using your testcase. Bugs/features are more likely to be fixed if: 1. There is a minimal testcase that reproduces the problem 2. Someone has debugged GCC and identified the problem 3. Someone has done all the legal prerequisites and posted a patch that fix= es the problem 4. Someone has tested and submitted the patch for review 5. Someone has taken care of the review comments and committed the patch We are not even in 1 and the real work is 2 and 3. >>From gcc-bugs-return-451351-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon May 12 15:58:28 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 14705 invoked by alias); 12 May 2014 15:58:27 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 14664 invoked by uid 55); 12 May 2014 15:58:24 -0000 From: "denisc at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/60991] [avr] Stack corruption when using 24-bit integers __int24 or __memx pointers in large stack frame Date: Mon, 12 May 2014 15:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: denisc at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-05/txt/msg01043.txt.bz2 Content-length: 842 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60991 --- Comment #5 from denisc at gcc dot gnu.org --- Author: denisc Date: Mon May 12 15:57:52 2014 New Revision: 210327 URL: http://gcc.gnu.org/viewcvs?rev=210327&root=gcc&view=rev Log: Backport from mainline 2014-05-12 Senthil Kumar Selvaraj PR target/60991 * config/avr/avr.c (avr_out_store_psi): Use correct constant to restore Y. Backport from mainline 2014-05-12 Senthil Kumar Selvaraj PR target/60991 * gcc.target/avr/pr60991.c: New testcase. Added: branches/gcc-4_9-branch/gcc/testsuite/gcc.target/avr/pr60991.c Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/config/avr/avr.c branches/gcc-4_9-branch/gcc/testsuite/ChangeLog