All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kumba <kumba@gentoo.org>
To: Manuel Lauss <mano@roarinelk.homelinux.net>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-mips@linux-mips.org
Subject: Re: [SOLVED] Re: GCC-4.3.3 sillyness
Date: Wed, 25 Feb 2009 00:13:20 -0500	[thread overview]
Message-ID: <49A4D370.3080300@gentoo.org> (raw)
In-Reply-To: <20090131085957.399614d1@scarran.roarinelk.net>

[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]

Manuel Lauss wrote:
> On Fri, 30 Jan 2009 08:44:07 +0100
> Manuel Lauss <mano@roarinelk.homelinux.net> wrote:
> 
>> Hello,
>>
>> Can't build kernel because gcc-4.3.3 comes up with this gem:
>>
>>   CC      arch/mips/kernel/traps.o
>> cc1: warnings being treated as errors
>> /linux-2.6.git/arch/mips/kernel/traps.c: In function 'set_uncached_handler':
>> /linux-2.6.git/arch/mips/kernel/traps.c:1599: error: format not a string literal and no format arguments
> 
> Turns out Gentoo applied a patch (from Debian) which unconditionally
> enables -Wformat-security (which is responsible for the warning).

Yeah, I did some digging and it looks like we added a patch called 
"10_all_gcc-default-format-security.patch" into our gcc-4.3.3 ebuild.  The patch 
claims it was ripped from Debian; can any Debian devs comment on whether you 
guys still use this patch and what the idea behind it is?  I'm not sure if I'll 
find any discussion on our end as to why it's included without finding Mike 
(vapier) around.


-- 
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org

"The past tempts us, the present confuses us, the future frightens us.  And our 
lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic

[-- Attachment #2: 10_all_gcc-default-format-security.patch --]
[-- Type: text/plain, Size: 1663 bytes --]

ripped from Debian

# DP: Turn on -Wformat -Wformat-security by  default for C, C++, ObjC, ObjC++.

--- gcc/c-common.c
+++ gcc/c-common.c
@@ -277,7 +277,7 @@
 /* Warn about format/argument anomalies in calls to formatted I/O functions
    (*printf, *scanf, strftime, strfmon, etc.).  */
 
-int warn_format;
+int warn_format = 1;
 
 /* Warn about using __null (as NULL in C++) as sentinel.  For code compiled
    with GCC this doesn't matter as __null is guaranteed to have the right
--- gcc/c.opt
+++ gcc/c.opt
@@ -228,7 +228,7 @@
 Warn about format strings that contain NUL bytes
 
 Wformat-security
-C ObjC C++ ObjC++ Var(warn_format_security) Warning
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning
 Warn about possible security problems with format functions
 
 Wformat-y2k
--- gcc/doc/invoke.texi
+++ gcc/doc/invoke.texi
@@ -2802,6 +2802,9 @@
 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
 
+NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++.
+To disable, use @option{-Wformat=0}.
+
 @item -Wformat-y2k
 @opindex Wformat-y2k
 @opindex Wno-format-y2k
@@ -2849,6 +2852,11 @@
 in future warnings may be added to @option{-Wformat-security} that are not
 included in @option{-Wformat-nonliteral}.)
 
+NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++.
+To disable, use @option{-Wno-format-security}, or disable all format warnings
+with @option{-Wformat=0}.  To make format security warnings fatal, specify
+@option{-Werror=format-security}.
+
 @item -Wformat=2
 @opindex Wformat=2
 @opindex Wno-format=2

  reply	other threads:[~2009-02-25  5:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-30  7:44 GCC-4.3.3 sillyness Manuel Lauss
2009-01-30  8:23 ` Geert Uytterhoeven
2009-01-30  8:55   ` Manuel Lauss
2009-01-30 14:03 ` Ralf Baechle
2009-01-30 16:56   ` Manuel Lauss
2009-01-31  7:59 ` [SOLVED] " Manuel Lauss
2009-02-25  5:13   ` Kumba [this message]
2009-02-26  2:48     ` Kumba

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=49A4D370.3080300@gentoo.org \
    --to=kumba@gentoo.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mano@roarinelk.homelinux.net \
    --cc=ralf@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.