{"thread":{"id":"28689","subject":"[PATCH] fmt-merge-msg.c: Fix an \"dubious one-bit signed bitfield\" sparse error","startedAt":"2011-10-15T17:46:59Z","lastAt":"2011-10-16T03:19:42Z","messageCount":2,"participants":["Ramsay Jones","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"177740","messageId":"4E99C713.4090802@ramsay1.demon.co.uk","threadId":"28689","inReplyTo":null,"subject":"[PATCH] fmt-merge-msg.c: Fix an \"dubious one-bit signed bitfield\" sparse error","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-10-15T17:46:59Z","receivedAt":"2011-10-15T17:46:59Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Junio,\n\nThis was originally part of the patch I sent last week (applied to next\nas commit 273c7032 - environment.c: Fix an sparse \"symbol not declared\" warning,\n09-10-2011), since they both blame to commit 898eacd8 (fmt-merge-msg: use \nbranch.$name.description, 06-10-2011).\n\nHowever, sparse only issued this particular error on Linux, and not cygwin\nor MinGW, so I decided to remove this part of the patch until I could\ninvestigate further.\n\nSo, I had a look this afternoon and, *literally*, after no more than a\nminute I realized why that is ... *blush*. Well, it may already be obvious,\nthat the Makefile has -Wno-one-bit-signed-bitfield set in the SPARSE_FLAGS\nfor cygwin and MinGW! *ahem* :-P  (now, who could have done that!)\n\nThis was mainly for the benefit of MinGW, since it otherwise issues 558 errors\n(2 * 279 compilations); cygwin only results in 2 errors as follows:\n\n        SP compat/cygwin.c\n    /usr/include/w32api/winuser.h:3083:28: error: dubious one-bit signed bitfield\n    /usr/include/w32api/winuser.h:3084:25: error: dubious one-bit signed bitfield\n\nsince only compat/cygwin.c, indirectly, includes that win32 header file.\n\nUnfortunately, you can't tell sparse not to issue errors/warnings for system\nheader files. I could have lived with just the two errors on cygwin, but I wanted\nat least one platform to be free of sparse errors/warnings. I remember thinking\nthat it would be OK to turn the messages off because I would notice them on\nLinux anyway! Ha! :-P\n\nBTW, t7800-difftool.sh fails for me on the next branch; I haven't investigated yet.\n\nATB,\nRamsay Jones\n\n builtin/fmt-merge-msg.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c\nindex 255a50f..7da6ff6 100644\n--- a/builtin/fmt-merge-msg.c\n+++ b/builtin/fmt-merge-msg.c\n@@ -37,7 +37,7 @@ struct src_data {\n \n struct origin_data {\n \tunsigned char sha1[20];\n-\tint is_local_branch:1;\n+\tunsigned int is_local_branch:1;\n };\n \n static void init_src_data(struct src_data *data)\n-- \n1.7.7\n"},{"id":"177759","messageId":"7vbothtt7g.fsf@alter.siamese.dyndns.org","threadId":"28689","inReplyTo":"4E99C713.4090802@ramsay1.demon.co.uk","subject":"Re: [PATCH] fmt-merge-msg.c: Fix an \"dubious one-bit signed bitfield\" sparse error","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-16T03:19:42Z","receivedAt":"2011-10-16T03:19:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n>  struct origin_data {\n>  \tunsigned char sha1[20];\n> -\tint is_local_branch:1;\n> +\tunsigned int is_local_branch:1;\n\nThanks, I overlooked this one.\n"}]}