[PATCH 1/2] Compile with -Wstrict-prototypes -Wmissing-prototypes

John Keeping john at keeping.me.uk
Thu Jan 14 14:32:58 CET 2016


On Thu, Jan 14, 2016 at 02:01:32PM +0100, Jason A. Donenfeld wrote:
> John - what compilers do you have in mind that don't accept this flag?
> I rather like it.

SunStudio certainly doesn't support these diagnostics.

I'm following what git.git does in this regard.  If you check
git/Makefile you'll see that it sets -Wall but nothing else.  Since our
makefile is derived from that I'd prefer to follow the same principle.

The important thing is that we maintain the CFLAGS/CGIT_CFLAGS split for
compiler tuning vs. "functional" flags; warnings are in the former
category and should be in CFLAGS but we need to think carefully about
where to add those and allow the user to override them.  I think they
would have to go in cgit.mk between "include Makefile" and
"-include $(CGIT_PREFIX)cgit.conf" which allows users to override them
in cgit.conf but not in git/config.mak.

I would much rather that we add a wrapper akin to Junio's maintainer
"Make" for git.git [1] that compiles with these stricter flags rather
than modifying the default makefile and causing pain for those on less
common systems.  It only takes a couple of people to have this turned on
for us to catch these issues reasonably quickly.

[1] https://github.com/git/git/blob/todo/Make


More information about the CGit mailing list