[PATCH] Add -Wdeclaration-after-statement to CFLAGS to help enforce the instructions in SubmittingPatches
- From
Johan Herland <johan@herland.net>
- Date
- May 27, 2007, 14:39 UTC
- Message-ID
- <200705271639.35267.johan@herland.net>
- In-Reply-To
- <Pine.LNX.4.64.0705211347540.6410@racer.site>
Signed-off-by: Johan Herland <johan@herland.net> --- On Monday 21 May 2007, Johannes Schindelin wrote:
Show 9 quoted lines
> > We do not appreciate C99 initializers, declarations after statements, > or "0" instead of "NULL". > > [...] > > +Also, variables have to be declared at the beginning of the block > +(you can check this with gcc, using the -Wdeclaration-after-statement > +option).
Why not automatically enforce it by putting -Wdeclaration-after-statement in the Makefile?
It should probably be protected by some GCC if-ery, but then again, so should this:
CC = gcc
Have fun!
...Johan
Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile index 29243c6..4e91516 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') # CFLAGS and LDFLAGS are for the users to override from the command line. -CFLAGS = -g -O2 -Wall +CFLAGS = -g -O2 -Wall -Wdeclaration-after-statement LDFLAGS = ALL_CFLAGS = $(CFLAGS) ALL_LDFLAGS = $(LDFLAGS)
-- 1.5.2.101.gee49f