From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60354 invoked by alias); 27 Feb 2015 14:48:52 -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 60324 invoked by uid 48); 27 Feb 2015 14:48:47 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/64955] RFE: have -Wformat suggest the correct format string to use Date: Fri, 27 Feb 2015 15:18: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: 5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW 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: keywords bug_status cf_reconfirmed_on cc component everconfirmed 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: 2015-02/txt/msg03076.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D64955 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Status|UNCONFIRMED |NEW Last reconfirmed| |2015-02-27 CC| |manu at gcc dot gnu.org Component|c++ |c Ever confirmed|0 |1 --- Comment #1 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to David Malcolm from comment #0) > Currently, -Wformat tells me that I got something wrong but doesn't tell = we > what the correct format string is: I think this should not be hard given the tables already available when checking formats. This could be an EasyHack. About generating a patch, we would first need precise locations within form= at strings (PR52952), then implement the fix-it hints (PR62314) and editors li= ke Emacs could parse them to patch the code. Unfortunately, the time I can dedicate to GCC has been very much reduced lately and I haven't been able to find anyone to continue this work. >>From gcc-bugs-return-478745-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Feb 27 14:56:40 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 101075 invoked by alias); 27 Feb 2015 14:56:40 -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 101005 invoked by uid 48); 27 Feb 2015 14:56:35 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/64955] RFE: have -Wformat suggest the correct format string to use Date: Fri, 27 Feb 2015 15:23: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: 5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc 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: 2015-02/txt/msg03077.txt.bz2 Content-length: 734 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64955 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- The problem here is that usually there are more possibilities of fixing the code, and so it is a question what to suggest, it might as well just annoy users when it constantly suggests the opposite hint the user wants to take. In some cases, it is desirable to change the format specifier, in others to change the argument (cast it to something, ...), etc.