From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44029 invoked by alias); 24 Feb 2015 18:12:54 -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 40622 invoked by uid 89); 24 Feb 2015 18:08:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-HELO: mail-la0-f48.google.com Received: from mail-la0-f48.google.com (HELO mail-la0-f48.google.com) (209.85.215.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 24 Feb 2015 18:03:09 +0000 Received: by labgq15 with SMTP id gq15so27583703lab.6 for ; Tue, 24 Feb 2015 10:02:02 -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: Tue, 24 Feb 2015 18:18: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/msg00049.txt.bz2 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); > ^~~~~~ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30789 invoked by alias); 24 Feb 2015 18:04:15 -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 29483 invoked by uid 89); 24 Feb 2015 18:02:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-HELO: mail-la0-f48.google.com Received: from mail-la0-f48.google.com (HELO mail-la0-f48.google.com) (209.85.215.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 24 Feb 2015 17:57:03 +0000 Received: by labgq15 with SMTP id gq15so27628139lab.3 for ; Tue, 24 Feb 2015 09:56:21 -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: Tue, 24 Feb 2015 18:04: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/msg00048.txt.bz2 Message-ID: <20150224180400.XUib4vIrxPa_GY7lw3Luz87LgxDt3Dnq2-ylTgaCsGk@z> 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); > ^~~~~~