[PATCH 1/2] Compile with -Wstrict-prototypes -Wmissing-prototypes
john at keeping.me.uk
Thu Jan 14 00:29:25 CET 2016
On Wed, Jan 13, 2016 at 05:25:06PM -0500, Peter Colberg wrote:
> Signed-off-by: Peter Colberg <peter at colberg.org>
I don't think we want to do this in the generic makefile. Not all
compilers will support these options so we can't blindly add them to
CFLAGS. Especially not CGIT_CFLAGS which is designed to be options to
compile the program; this is more along the lines of user customization
which would go in CFLAGS (which is expected to be overridden in the
environment or on the make command line) before being captured into
You can update CFLAGS in cgit.conf or git/config.mak for site-specific
customization. Maybe Ferry can set that up on his Jenkins instance.
> cgit.mk | 5 +++++
> 1 file changed, 5 insertions(+)
> diff --git a/cgit.mk b/cgit.mk
> index 1b50307..f8fc6b3 100644
> --- a/cgit.mk
> +++ b/cgit.mk
> @@ -21,6 +21,11 @@ CGIT_CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"'
> CGIT_CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"'
> CGIT_CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"'
> +# Warn if function is declared or defined without argument types
> +CGIT_CFLAGS += -Wstrict-prototypes
> +# Warn if function is defined without previous declaration in header
> +CGIT_CFLAGS += -Wmissing-prototypes
> ifdef NO_C99_FORMAT
> CFLAGS += -DNO_C99_FORMAT
More information about the CGit