git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fmt-merge-msg.c: Fix an "dubious one-bit signed bitfield" sparse error
@ 2011-10-15 17:46 Ramsay Jones
  2011-10-16  3:19 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2011-10-15 17:46 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT Mailing-list


Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---

Hi Junio,

This was originally part of the patch I sent last week (applied to next
as commit 273c7032 - environment.c: Fix an sparse "symbol not declared" warning,
09-10-2011), since they both blame to commit 898eacd8 (fmt-merge-msg: use 
branch.$name.description, 06-10-2011).

However, sparse only issued this particular error on Linux, and not cygwin
or MinGW, so I decided to remove this part of the patch until I could
investigate further.

So, I had a look this afternoon and, *literally*, after no more than a
minute I realized why that is ... *blush*. Well, it may already be obvious,
that the Makefile has -Wno-one-bit-signed-bitfield set in the SPARSE_FLAGS
for cygwin and MinGW! *ahem* :-P  (now, who could have done that!)

This was mainly for the benefit of MinGW, since it otherwise issues 558 errors
(2 * 279 compilations); cygwin only results in 2 errors as follows:

        SP compat/cygwin.c
    /usr/include/w32api/winuser.h:3083:28: error: dubious one-bit signed bitfield
    /usr/include/w32api/winuser.h:3084:25: error: dubious one-bit signed bitfield

since only compat/cygwin.c, indirectly, includes that win32 header file.

Unfortunately, you can't tell sparse not to issue errors/warnings for system
header files. I could have lived with just the two errors on cygwin, but I wanted
at least one platform to be free of sparse errors/warnings. I remember thinking
that it would be OK to turn the messages off because I would notice them on
Linux anyway! Ha! :-P

BTW, t7800-difftool.sh fails for me on the next branch; I haven't investigated yet.

ATB,
Ramsay Jones

 builtin/fmt-merge-msg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 255a50f..7da6ff6 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -37,7 +37,7 @@ struct src_data {
 
 struct origin_data {
 	unsigned char sha1[20];
-	int is_local_branch:1;
+	unsigned int is_local_branch:1;
 };
 
 static void init_src_data(struct src_data *data)
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fmt-merge-msg.c: Fix an "dubious one-bit signed bitfield" sparse error
  2011-10-15 17:46 [PATCH] fmt-merge-msg.c: Fix an "dubious one-bit signed bitfield" sparse error Ramsay Jones
@ 2011-10-16  3:19 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2011-10-16  3:19 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: GIT Mailing-list

Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:

>  struct origin_data {
>  	unsigned char sha1[20];
> -	int is_local_branch:1;
> +	unsigned int is_local_branch:1;

Thanks, I overlooked this one.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-16  5:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-15 17:46 [PATCH] fmt-merge-msg.c: Fix an "dubious one-bit signed bitfield" sparse error Ramsay Jones
2011-10-16  3:19 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).