From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57149 invoked by alias); 24 Feb 2015 18:18:49 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 47291 invoked by uid 89); 24 Feb 2015 18:15:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-HELO: ausxippc110.us.dell.com Received: from AUSXIPPC110.us.dell.com (HELO ausxippc110.us.dell.com) (143.166.85.200) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 24 Feb 2015 18:10:28 +0000 X-LoopCount0: from 10.175.216.249 From: To: CC: Subject: Re: format string is not a string literal Date: Wed, 25 Feb 2015 07:58:00 -0000 Message-ID: <0AB56024-875B-4724-8ED2-A9DDB237CBFF@dell.com> References: In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00050.txt.bz2 DQo+IE9uIEZlYiAyNCwgMjAxNSwgYXQgMTI6MTMgUE0sIEphY2sgSG93YXJ0 aCA8aG93YXJ0aC5tYWlsaW5nLmxpc3RzQGdtYWlsLmNvbT4gd3JvdGU6DQo+ IA0KPiAgIEJ1aWxkaW5nIGdkYiA3Ljkgb24geDg2XzY0LWFwcGxlLWRhcndp bjE0IHByb2R1Y2VzIGEgbnVtYmVyIG9mDQo+IHdhcm5pbmdzIGZyb20gLVdm b3JtYXQtbm9ubGl0ZXJhbC4uLg0KDQpTb3VuZHMgbGlrZSBpdOKAmXMgdGlt ZSB0byB0dXJuIG9mZiB0aGF0IHdhcm5pbmcsIHNpbmNlIHRoZSBjb2RlIGlz IGxlZ2l0Lg0KDQoJcGF1bA0K >From gdb-return-44129-listarch-gdb=sources.redhat.com@sourceware.org Tue Feb 24 18:20:06 2015 Return-Path: Delivered-To: listarch-gdb@sources.redhat.com Received: (qmail 63496 invoked by alias); 24 Feb 2015 18:20:06 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Delivered-To: mailing list gdb@sourceware.org Received: (qmail 63465 invoked by uid 89); 24 Feb 2015 18:20:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-la0-f51.google.com Received: from mail-la0-f51.google.com (HELO mail-la0-f51.google.com) (209.85.215.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 24 Feb 2015 18:20:03 +0000 Received: by labgd6 with SMTP id gd6so27540300lab.7 for ; Tue, 24 Feb 2015 10:20:00 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.185.66 with SMTP id fa2mr11440057lbc.117.1424800581131; Tue, 24 Feb 2015 09:56:21 -0800 (PST) Received: by 10.25.21.213 with HTTP; Tue, 24 Feb 2015 09:56:21 -0800 (PST) In-Reply-To: References: Date: Wed, 25 Feb 2015 09:42:00 -0000 Message-ID: Subject: Re: format string is not a string literal From: Andrew Pinski To: Jack Howarth Cc: GDB Development Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00051.txt.bz2 Content-length: 3153 On Tue, Feb 24, 2015 at 9:13 AM, Jack Howarth wrote: > Building gdb 7.9 on x86_64-apple-darwin14 produces a number of > warnings from -Wformat-nonliteral... > > darwin-nat.c:184:23: warning: format string is not a string literal > [-Wformat-nonliteral] > vprintf_unfiltered (fmt, ap); > ^~~ Looks like a clang bug because vprintf takes a format and an va_arg type which means there is no way to tell what the format is going to look into. Looks like all are the same clang bug. Please file a bug with Apple and/or LLVM about this bring broken. > > remote.c:6986:37: warning: format string is not a string literal > [-Wformat-nonliteral] > if (vsnprintf (rs->buf, max_size, format, ap) >= max_size) > ^~~~~~ > /usr/include/secure/_stdio.h:75:63: note: expanded from macro 'vsnprintf' > __builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap) > ^ See how they even warn about their own header too. Thanks, Andrew > ctf.c:109:39: warning: format string is not a string literal > [-Wformat-nonliteral] > if (vfprintf (handler->metadata_fd, format, args) < 0) > ^~~~~~ > > ./guile/scm-string.c:70:25: warning: format string is not a string > literal [-Wformat-nonliteral] > string = xstrvprintf (format, args); > ^~~~~~ > > ./guile/scm-utils.c:86:25: warning: format string is not a string > literal [-Wformat-nonliteral] > string = xstrvprintf (format, args); > ^~~~~~ > > auto-load.c:486:40: warning: format string is not a string literal > [-Wformat-nonliteral] > vfprintf_unfiltered (gdb_stdlog, debug_fmt, debug_args); > ^~~~~~~~~ > > complaints.c:188:10: warning: format string is not a string literal > [-Wformat-nonliteral] > complaint->fmt, args); > ^~~~~~~~~~~~~~ > complaints.c:195:12: warning: format string is not a string literal > [-Wformat-nonliteral] > vwarning (complaint->fmt, args); > ^~~~~~~~~~~~~~ > complaints.c:200:23: warning: format string is not a string literal > [-Wformat-nonliteral] > msg = xstrvprintf (complaint->fmt, args); > ^~~~~~~~~~~~~~ > > ./compile/compile-object-load.c:235:22: warning: format string is not > a string literal [-Wformat-nonliteral] > str = xstrvprintf (fmt, ap); > ^~~ > ./compile/compile-loc2c.c:453:30: warning: format string is not a > string literal [-Wformat-nonliteral] > vfprintf_filtered (stream, format, args); > ^~~~~~ > ./compile/compile-loc2c.c:470:30: warning: format string is not a > string literal [-Wformat-nonliteral] > vfprintf_filtered (stream, format, args); > ^~~~~~ > ./compile/compile-loc2c.c:485:30: warning: format string is not a > string literal [-Wformat-nonliteral] > vfprintf_filtered (stream, format, args); > ^~~~~~