From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31038 invoked by alias); 5 Jun 2010 13:18:22 -0000 Received: (qmail 31029 invoked by uid 22791); 5 Jun 2010 13:18:21 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 05 Jun 2010 13:18:15 +0000 Received: (qmail 23038 invoked from network); 5 Jun 2010 13:18:14 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Jun 2010 13:18:14 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.69) (envelope-from ) id 1OKtGO-0007zg-Jv; Sat, 05 Jun 2010 13:18:12 +0000 Date: Sat, 05 Jun 2010 13:18:00 -0000 From: "Joseph S. Myers" To: Shujing Zhao cc: GCC Patches , Paolo Carlini Subject: Re: [PATCH C/C++] Fix some diagnostics problems In-Reply-To: <4C08C912.7030906@oracle.com> Message-ID: References: <4C08C912.7030906@oracle.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-06/txt/msg00402.txt.bz2 On Fri, 4 Jun 2010, Shujing Zhao wrote: > Hi, > > This patch is to cleanup the codes that pass ("%s", message) to diagnostic > functions, such as error, warning etc. If there some format specifiers in > 'message', they would not be recognized. If it need be translated, 'message' > need be wrapped with _() explicitly, while 'message' could be translated in > diagnostic functions. I thinks pass the 'message' directly to those functions > would be better. The Ubuntu etc. people enabling -Wformat-security by default will dislike this sort of change. I disagree with their choice, but it should be possible to fix i18n issues in a way that is simultaneously friendly to -Wformat-security - in particular, including strings directly in diagnostic function calls whenever possible so that they can actually be checked at compile time. This patch suffers from doing far too many things at once. Some bits might be OK, but various parts are wrong, meaning the whole patch has to be rejected. Please submit patches that do just one thing and cannot sensibly be subdivided into smaller patches. As examples of the things done wrong, strsignal returns a *string* that is not a *format string* and that it is definitely incorrect to treat as a format string. %e and %n specs are not documented (in the comment in gcc.c that documents specs, or in the unfortunate duplicate documentation in invoke.texi) as taking format strings; if you change the implementation, you must change the interface documentation. Likewise for other cases of action at a distance in this patch: if you change something from a verbatim string to a format string at the site where the string is called, you must make sure the interface documentation describes this change, and that the relevant strings are marked as gcc-internal-format in gcc.pot to indicate this to translators, and confirm that you have checked that this is appropriate for all callers. -- Joseph S. Myers joseph@codesourcery.com