public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.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 12:26:00 -0000	[thread overview]
Message-ID: <bug-39438-4-DgVADzIAoZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-39438-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39438

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Could you produce a complete testcase that (In reply to D. Hugh Redelmeier from
comment #4)
> I have this problem too.  I'm writing a wrapper for strftime.  I get a
> warning on the actual strftime call.  
> 
> warning: format not a string literal, format string not checked
> [-Wformat-nonliteral]
>   strftime(buf, buflen, fmt, t);
> 
> Surely GCC should not that for "fmt" argument has been checked to be a valid
> strftime format at the points where prettynow gets called.  So there is no
> need to whine that it is unchecked.
> 

You should be able to produce a minimal self-contained testcase (the one you
posted doesn't compile). See http://gcc.gnu.org/bugs/minimize.html
The best would be to include only the definitions of the types that you need
and declare as 'extern' library functions that you use to avoid including
headers.

If you can produce another similar example that works with printf, that would
also help.

The second step would be to find out why it works with printf and not with
strftime, but that would require debugging GCC while compiling your (new)
testcases, so saving the first step will make it more likely that someone will
do the second.
>From gcc-bugs-return-451316-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon May 12 12:29:46 2014
Return-Path: <gcc-bugs-return-451316-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5468 invoked by alias); 12 May 2014 12:29:46 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 5419 invoked by uid 48); 12 May 2014 12:29:43 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/61146] wide-int error when building GCC with clang
Date: Mon, 12 May 2014 12:29:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: other
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
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: <bug-61146-4-zUoEyirwTX@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61146-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61146-4@http.gcc.gnu.org/bugzilla/>
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/msg01008.txt.bz2
Content-length: 800

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61146

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #0)
> The *FLAGS_FOR_TARGET are required or else they will be set to *FLAGS, which
> will pass -fheinous-gnu-extensions to the SH xgcc when building libgcc etc.
> (PR 25672)

It is funny that Clang has a flag called "heinous-gnu-extensions". I wonder
what other things are enabled by that (what they think are heinous GNU
extensions and why).
>From gcc-bugs-return-451317-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon May 12 12:36:56 2014
Return-Path: <gcc-bugs-return-451317-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 8892 invoked by alias); 12 May 2014 12:36:56 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 8856 invoked by uid 48); 12 May 2014 12:36:52 -0000
From: "bugdal at aerifal dot cx" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
Date: Mon, 12 May 2014 12:36: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: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: bugdal at aerifal dot cx
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: <bug-61144-4-0GUOdNCgqO@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61144-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61144-4@http.gcc.gnu.org/bugzilla/>
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/msg01009.txt.bz2
Content-length: 367

http://gcc.gnu.org/bugzilla/show_bug.cgi?ida144

--- Comment #8 from Rich Felker <bugdal at aerifal dot cx> ---
Further investigation suggests that the real gcc 4.8.2 is not affected; I was
mislead by the fact that Debian is shipping as "gcc-4.8_4.8.2-21" an svn
snapshot that's actually post-4.8.2. So 4.9.0 seems to be the only official
release that's affected.


  parent reply	other threads:[~2014-05-12 12:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-39438-4@http.gcc.gnu.org/bugzilla/>
2012-01-10 20:39 ` tss at iki dot fi
2014-05-10 16:47 ` hugh at mimosa dot com
2014-05-12 12:26 ` manu at gcc dot gnu.org [this message]
2014-05-12 14:58 ` hugh at mimosa dot com
2014-05-12 15:38 ` manu at gcc dot gnu.org
2014-05-12 15:52 ` manu at gcc dot gnu.org
2014-05-12 19:33 ` hugh at mimosa dot com
2015-02-27 16:43 ` manu at gcc dot gnu.org
2024-06-03  1:48 ` peter0x44 at disroot dot org
2009-03-11 22:57 [Bug c/39438] New: " 4tmuelle at informatik dot uni-hamburg dot de
2009-03-12  9:40 ` [Bug c/39438] " rguenth at gcc dot gnu dot org
2009-03-12  9:58 ` 4tmuelle at informatik dot uni-hamburg dot de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-39438-4-DgVADzIAoZ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).