linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: Josh Triplett <josh@freedesktop.org>
Cc: linux-sparse@vger.kernel.org
Subject: [PATCH] Fix warning on self check.
Date: Wed, 22 Nov 2006 23:47:43 -0800	[thread overview]
Message-ID: <20061123074743.GB9322@chrisli.org> (raw)
In-Reply-To: <456332E3.6020107@freedesktop.org>

Fix warning on self check

Sparse complain about the using do while without
compound statment in pre-process.c. This trivial patch
fixes that.

Signed-Off-By: Christopher Li <sparse@chrisli.org>

Index: sparse/pre-process.c
===================================================================
--- sparse.orig/pre-process.c	2006-11-22 04:05:10.000000000 -0800
+++ sparse/pre-process.c	2006-11-22 23:44:34.000000000 -0800
@@ -43,20 +43,24 @@
 static const char **angle_includepath = includepath + 1;
 static const char **sys_includepath   = includepath + 1;
 
-#define dirty_stream(stream)			\
-	do if (!stream->dirty) {		\
-		stream->dirty = 1;		\
-		if (!stream->ifndef)		\
-			stream->protect = NULL;	\
+#define dirty_stream(stream)				\
+	do {						\
+		if (!stream->dirty) {			\
+			stream->dirty = 1;		\
+			if (!stream->ifndef)		\
+				stream->protect = NULL;	\
+		}					\
 	} while(0)
 
-#define end_group(stream)				\
-	do if (stream->ifndef == stream->top_if) {	\
-		stream->ifndef = NULL;			\
-		if (!stream->dirty)			\
-			stream->protect = NULL;		\
-		else if (stream->protect)		\
-			stream->dirty = 0;		\
+#define end_group(stream)					\
+	do {							\
+		if (stream->ifndef == stream->top_if) {		\
+			stream->ifndef = NULL;			\
+			if (!stream->dirty)			\
+				stream->protect = NULL;		\
+			else if (stream->protect)		\
+				stream->dirty = 0;		\
+		}						\
 	} while(0)
 
 #define nesting_error(stream)		\

  reply	other threads:[~2006-11-23  7:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14  9:00 [TRIVIAL][PATCH] double inclusions Nicolas Kaiser
2006-11-21 17:09 ` Josh Triplett
2006-11-23  7:47   ` Christopher Li [this message]
2006-11-28 20:42     ` [PATCH] Fix warning on self check Josh Triplett

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=20061123074743.GB9322@chrisli.org \
    --to=sparse@chrisli.org \
    --cc=josh@freedesktop.org \
    --cc=linux-sparse@vger.kernel.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).