diff mbox

fix build failure w. gcc-4.3.3

Message ID 20090130102854.GA13640@roarinelk.homelinux.net (mailing list archive)
State Not Applicable
Headers show

Commit Message

Manuel Lauss Jan. 30, 2009, 10:28 a.m. UTC
gcc-4.3.3 likes to have printf() and related functions to have
at least 2 arguments when the format string is not a constant:

cc1: warnings being treated as error
arch/sh/kernel/setup.c: In function 'early_parse_mem':
arch/sh/kernel/setup.c:111: error: format not a string literal and no format arguments

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
---
 arch/sh/kernel/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Manuel Lauss Jan. 31, 2009, 8:46 a.m. UTC | #1
On Fri, 30 Jan 2009 11:28:54 +0100
Manuel Lauss <mano@roarinelk.homelinux.net> wrote:

> gcc-4.3.3 likes to have printf() and related functions to have
> at least 2 arguments when the format string is not a constant:
> 
> cc1: warnings being treated as error
> arch/sh/kernel/setup.c: In function 'early_parse_mem':
> arch/sh/kernel/setup.c:111: error: format not a string literal and no format arguments

Please disregard this patch:  turns out that Gentoo applied a patch
which unconditionally enables -Wformat-security and produces this
message.

My Apologies!

Manuel Lauss

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mike Frysinger Jan. 31, 2009, 4:56 p.m. UTC | #2
On Saturday 31 January 2009 03:46:05 Manuel Lauss wrote:
> On Fri, 30 Jan 2009 11:28:54 +0100
>
> Manuel Lauss <mano@roarinelk.homelinux.net> wrote:
> > gcc-4.3.3 likes to have printf() and related functions to have
> > at least 2 arguments when the format string is not a constant:
> >
> > cc1: warnings being treated as error
> > arch/sh/kernel/setup.c: In function 'early_parse_mem':
> > arch/sh/kernel/setup.c:111: error: format not a string literal and no
> > format arguments
>
> Please disregard this patch:  turns out that Gentoo applied a patch
> which unconditionally enables -Wformat-security and produces this
> message.

that's incorrect.  the patch sets format-security on by default, not 
unconditionally.  having the common kernel itself build with -Wno-format-
security probably is worthwhile.
-mike
Manuel Lauss Jan. 31, 2009, 5:13 p.m. UTC | #3
On Sat, 31 Jan 2009 11:56:05 -0500
Mike Frysinger <vapier@gentoo.org> wrote:

> On Saturday 31 January 2009 03:46:05 Manuel Lauss wrote:
> > On Fri, 30 Jan 2009 11:28:54 +0100
> >
> > Manuel Lauss <mano@roarinelk.homelinux.net> wrote:
> > > gcc-4.3.3 likes to have printf() and related functions to have
> > > at least 2 arguments when the format string is not a constant:
> > >
> > > cc1: warnings being treated as error
> > > arch/sh/kernel/setup.c: In function 'early_parse_mem':
> > > arch/sh/kernel/setup.c:111: error: format not a string literal and no
> > > format arguments
> >
> > Please disregard this patch:  turns out that Gentoo applied a patch
> > which unconditionally enables -Wformat-security and produces this
> > message.
> 
> that's incorrect.  the patch sets format-security on by default, not 
> unconditionally.  having the common kernel itself build with -Wno-format-
> security probably is worthwhile.

Well, at least here -Wno-format-security doesn't work, neither on x86,
sh nor mips.  Otherwise I would have sent a patch doing exactly that.

-- ml.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mike Frysinger Jan. 31, 2009, 5:35 p.m. UTC | #4
On Saturday 31 January 2009 12:13:26 Manuel Lauss wrote:
> On Sat, 31 Jan 2009 11:56:05 -0500 Mike Frysinger wrote:
> > On Saturday 31 January 2009 03:46:05 Manuel Lauss wrote:
> > > On Fri, 30 Jan 2009 11:28:54 +0100 Manuel Lauss wrote:
> > > > gcc-4.3.3 likes to have printf() and related functions to have
> > > > at least 2 arguments when the format string is not a constant:
> > > >
> > > > cc1: warnings being treated as error
> > > > arch/sh/kernel/setup.c: In function 'early_parse_mem':
> > > > arch/sh/kernel/setup.c:111: error: format not a string literal and no
> > > > format arguments
> > >
> > > Please disregard this patch:  turns out that Gentoo applied a patch
> > > which unconditionally enables -Wformat-security and produces this
> > > message.
> >
> > that's incorrect.  the patch sets format-security on by default, not
> > unconditionally.  having the common kernel itself build with -Wno-format-
> > security probably is worthwhile.
>
> Well, at least here -Wno-format-security doesn't work, neither on x86,
> sh nor mips.  Otherwise I would have sent a patch doing exactly that.

works fine for me.  not that it matters as the kernel already can handle this:
KBUILD_CFLAGS += $(call cc-option,-Wno-format-security,)

also, this isnt a Gentoo specific issue.  other distros are enabling this flag 
by default as well.  they just dont make cross-compiler generation as easy as 
Gentoo ;).
-mike
Manuel Lauss Jan. 31, 2009, 5:53 p.m. UTC | #5
On Sat, 31 Jan 2009 12:35:21 -0500
Mike Frysinger <vapier@gentoo.org> wrote:

> On Saturday 31 January 2009 12:13:26 Manuel Lauss wrote:
> > On Sat, 31 Jan 2009 11:56:05 -0500 Mike Frysinger wrote:
> > > On Saturday 31 January 2009 03:46:05 Manuel Lauss wrote:
> > > > On Fri, 30 Jan 2009 11:28:54 +0100 Manuel Lauss wrote:
> > > > > gcc-4.3.3 likes to have printf() and related functions to have
> > > > > at least 2 arguments when the format string is not a constant:
> > > > >
> > > > > cc1: warnings being treated as error
> > > > > arch/sh/kernel/setup.c: In function 'early_parse_mem':
> > > > > arch/sh/kernel/setup.c:111: error: format not a string literal and no
> > > > > format arguments
> > > >
> > > > Please disregard this patch:  turns out that Gentoo applied a patch
> > > > which unconditionally enables -Wformat-security and produces this
> > > > message.
> > >
> > > that's incorrect.  the patch sets format-security on by default, not
> > > unconditionally.  having the common kernel itself build with -Wno-format-
> > > security probably is worthwhile.
> >
> > Well, at least here -Wno-format-security doesn't work, neither on x86,
> > sh nor mips.  Otherwise I would have sent a patch doing exactly that.
> 
> works fine for me.  not that it matters as the kernel already can handle this:
> KBUILD_CFLAGS += $(call cc-option,-Wno-format-security,)

I was beginning to suspect something bad on my end.
 
> also, this isnt a Gentoo specific issue.  other distros are enabling this flag 
> by default as well.  they just dont make cross-compiler generation as easy as 
> Gentoo ;).
> -mike

That's why I like Gentoo so much ;-)

In any case, I rebuilt all compilers without this patch so it's no
longer a concern for me.

Thanks Mike,
	Manuel Lauss
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 5342475..72a08f6 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -108,7 +108,7 @@  static int __init early_parse_mem(char *p)
 			"is not allowed.\n"
 			"  Recompile the kernel with the correct value for "
 			"CONFIG_MEMORY_SIZE.\n";
-		printk(msg);
+		printk("%s", msg);
 		return 0;
 	}