From: Jeff King Date: Tue, 10 Jun 2014 00:22:03 GMT Subject: Re: [PATCH 12/15] use get_commit_buffer everywhere Message-ID: <20140610002202.GB20644@sigill.intra.peff.net> In-Reply-To: <20140610000223.GA20644@sigill.intra.peff.net> On Mon, Jun 09, 2014 at 08:02:24PM -0400, Jeff King wrote: > I'm still confused and disturbed that my gcc is not noticing this > obvious const violation. Hmm, shutting off ccache seems to make it work. > Doubly disturbing. Ah, mystery solved. It's a gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60014 I get: $ gcc -c -Wall -Werror -DSHA1_HEADER='"block-sha1/sha1.h"' notes-merge.c notes-merge.c: In function ‘notes_merge_commit’: notes-merge.c:723:2: error: passing argument 2 of ‘strbuf_attach’ discards ‘const’ qualifier from pointer target type [-Werror] ...etc... $ gcc -E -Wall -Werror -DSHA1_HEADER='"block-sha1/sha1.h"' notes-merge.c >foo.c $ gcc -c -Wall -Werror -DSHA1_HEADER='"block-sha1/sha1.h"' foo.c [no warnings from either] ccache uses the latter technique. -Peff