lkml.org 
[lkml]   [2009]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC Patch] kbuild: remove -Wdeclaration-after-statement
Amerigo Wang writes:
>
> I got lots of "ISO C90 forbids mixed declarations and code" warnings
> during compile today's kernel.
>
> I think we can remove the gcc option '-Wdeclaration-after-statement'
> now, since we already have C99 for 10 years. :)
>
> Signed-off-by: WANG Cong <amwang@redhat.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
>
> ---
> diff --git a/Makefile b/Makefile
> index 433493a..038bda2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -559,9 +559,6 @@ endif
> NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
> CHECKFLAGS += $(NOSTDINC_FLAGS)
>
> -# warn about C99 declaration after statement
> -KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
> -
> # disable pointer signed / unsigned warnings in gcc 4.0
> KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)

This is more a matter of coding-style policy than C technicalities.

I happen to hate declarations at random places in the code, so I'd
prefer the offending code to be fixed instead.


\
 
 \ /
  Last update: 2009-09-23 12:23    [W:0.067 / U:1.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site