linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Emilio G. Cota" <cota@braap.org>
To: Christopher Li <sparse@chrisli.org>
Cc: "Emilio G. Cota" <cota@braap.org>,
	Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: [PATCH] Define __CHAR_BIT__
Date: Thu, 19 Dec 2013 00:46:27 -0500	[thread overview]
Message-ID: <1387431987-29219-1-git-send-email-cota@braap.org> (raw)

From: "Emilio G. Cota" <cota@braap.org>

gcc defines __CHAR_BIT__ as a pre-defined macro.

Define __CHAR_BIT__ in sparse so that code that needs it (e.g. code
using CHAR_BIT from limits.h) does not generate false warnings.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 lib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib.c b/lib.c
index fe20f93..bbdb9b7 100644
--- a/lib.c
+++ b/lib.c
@@ -911,6 +911,7 @@ void create_builtin_stream(void)
 	add_pre_buffer("#weak_define __LONG_LONG_MAX__ " STRINGIFY(__LONG_LONG_MAX__) "\n");
 	add_pre_buffer("#weak_define __WCHAR_MAX__ " STRINGIFY(__WCHAR_MAX__) "\n");
 	add_pre_buffer("#weak_define __SIZEOF_POINTER__ " STRINGIFY(__SIZEOF_POINTER__) "\n");
+	add_pre_buffer("#weak_define __CHAR_BIT__ " STRINGIFY(__CHAR_BIT__) "\n");
 }
 
 static struct symbol_list *sparse_tokenstream(struct token *token)
-- 
1.8.3


             reply	other threads:[~2013-12-19  5:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-19  5:46 Emilio G. Cota [this message]
2013-12-21 17:20 ` [PATCH] Define __CHAR_BIT__ Christopher Li
2014-01-08 21:32   ` [PATCH v2] " Emilio G. Cota
2014-01-28 21:38     ` Emilio G. Cota

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1387431987-29219-1-git-send-email-cota@braap.org \
    --to=cota@braap.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).