From: Josh Triplett <josh@freedesktop.org>
To: linux-sparse@vger.kernel.org
Subject: [RFC PATCH] Make sparse return 1 if errors occurred
Date: Sat, 14 Jul 2007 13:51:24 -0700 [thread overview]
Message-ID: <4699374C.1030303@freedesktop.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 3729 bytes --]
Sparse always returned 0. Change it to return 1 if errors occurred, and
remove check-known-to-fail from tests that expected that behavior.
Also rename the misleadingly named global die_if_error to had_errors.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
---
lib.c | 4 ++--
lib.h | 2 +-
sparse.c | 2 +-
validation/bad-array-designated-initializer.c | 2 --
validation/bad-assignment.c | 2 --
validation/preprocessor/preprocessor18.c | 2 --
validation/preprocessor/preprocessor21.c | 2 --
7 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/lib.c b/lib.c
index a1442a2..be1aca4 100644
--- a/lib.c
+++ b/lib.c
@@ -29,7 +29,7 @@
#include "target.h"
int verbose, optimize, optimize_size, preprocessing;
-int die_if_error = 0;
+int had_errors = 0;
#ifndef __GNUC__
# define __GNUC__ 2
@@ -129,7 +129,7 @@ void warning(struct position pos, const char * fmt, ...)
static void do_error(struct position pos, const char * fmt, va_list args)
{
static int errors = 0;
- die_if_error = 1;
+ had_errors = 1;
show_info = 1;
/* Shut up warnings after an error */
max_warnings = 0;
diff --git a/lib.h b/lib.h
index aacafea..a5e9f8e 100644
--- a/lib.h
+++ b/lib.h
@@ -18,7 +18,7 @@
#include "ptrlist.h"
extern int verbose, optimize, optimize_size, preprocessing;
-extern int die_if_error;
+extern int had_errors;
extern int repeat_phase, merge_phi_sources;
extern int gcc_major, gcc_minor, gcc_patchlevel;
diff --git a/sparse.c b/sparse.c
index 4026ba7..2f74194 100644
--- a/sparse.c
+++ b/sparse.c
@@ -283,5 +283,5 @@ int main(int argc, char **argv)
FOR_EACH_PTR_NOTAG(filelist, file) {
check_symbols(sparse(file));
} END_FOR_EACH_PTR_NOTAG(file);
- return 0;
+ return had_errors;
}
diff --git a/validation/bad-array-designated-initializer.c b/validation/bad-array-designated-initializer.c
index ecc5bd3..75e8a10 100644
--- a/validation/bad-array-designated-initializer.c
+++ b/validation/bad-array-designated-initializer.c
@@ -12,6 +12,4 @@ bad-array-designated-initializer.c:3:3: error: Expected constant expression
bad-array-designated-initializer.c:3:3: error: Expected } at end of initializer
bad-array-designated-initializer.c:3:3: error: got \
* check-output-end
- *
- * check-known-to-fail
*/
diff --git a/validation/bad-assignment.c b/validation/bad-assignment.c
index 66f6fe8..f876076 100644
--- a/validation/bad-assignment.c
+++ b/validation/bad-assignment.c
@@ -13,6 +13,4 @@ static int foo(int a)
bad-assignment.c:3:6: error: Expected ; at end of statement
bad-assignment.c:3:6: error: got \
* check-output-end
- *
- * check-known-to-fail
*/
diff --git a/validation/preprocessor/preprocessor18.c b/validation/preprocessor/preprocessor18.c
index b4de1e6..b864010 100644
--- a/validation/preprocessor/preprocessor18.c
+++ b/validation/preprocessor/preprocessor18.c
@@ -12,6 +12,4 @@ preprocessor/preprocessor18.c:2:2: error: expected identifier to 'define'
preprocessor/preprocessor18.c:3:2: error: expected identifier to 'undef'
* check-output-end
- *
- * check-known-to-fail
*/
diff --git a/validation/preprocessor/preprocessor21.c b/validation/preprocessor/preprocessor21.c
index 1719fc0..ce62dbb 100644
--- a/validation/preprocessor/preprocessor21.c
+++ b/validation/preprocessor/preprocessor21.c
@@ -11,6 +11,4 @@ preprocessor/preprocessor21.c:2:2: error: unterminated preprocessor conditional
* check-output-end
- *
- * check-known-to-fail
*/
--
1.5.2.3
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
reply other threads:[~2007-07-14 20:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4699374C.1030303@freedesktop.org \
--to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.