linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] Compile sparse executable under it's own name, not as "check"
@ 2006-11-03 22:16 Pavel Roskin
  2006-11-03 22:17 ` [PATCH 2/4] Install cgcc on "make install", refactor installation code Pavel Roskin
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Pavel Roskin @ 2006-11-03 22:16 UTC (permalink / raw)
  To: linux-sparse

From: Pavel Roskin <proski@gnu.org>

No need to confuse everyone.  Besides, it allows to use "make check" for
some something meaningful in the future.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 Makefile |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index ccf9f89..da4a47a 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ CFLAGS += -DDEBUG
 
 PREFIX=$(HOME)
 BINDIR=$(PREFIX)/bin
-PROGRAMS=test-lexing test-parsing obfuscate check compile graph test-linearize example test-unssa test-dissect
+PROGRAMS=test-lexing test-parsing obfuscate compile graph sparse test-linearize example test-unssa test-dissect
 
 LIB_H=    token.h parse.h lib.h symbol.h scope.h expression.h target.h \
 	  linearize.h bitmap.h ident-list.h compat.h flow.h allocate.h \
@@ -39,12 +39,7 @@ LIBS=$(LIB_FILE)
 
 all: $(PROGRAMS) $(SLIB_FILE)
 
-#
-# Install the 'check' binary as 'sparse', just to confuse people.
-#
-#		"The better to keep you on your toes, my dear".
-#
-install: check $(SLIB_FILE) bin-dir
+install: sparse $(SLIB_FILE) bin-dir
 	if test $< -nt $(BINDIR)/sparse ; then install -v $< $(BINDIR)/sparse ; install -v $(SLIB_FILE) $(BINDIR) ; fi
 
 bin-dir:
@@ -74,7 +69,7 @@ compile: compile.o compile-i386.o $(LIBS
 obfuscate: obfuscate.o $(LIBS)
 	$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
 
-check: check.o $(LIBS)
+sparse: check.o $(LIBS)
 	$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
 
 graph: graph.o $(LIBS)

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

* [PATCH 2/4] Install cgcc on "make install", refactor installation code
  2006-11-03 22:16 [PATCH 1/4] Compile sparse executable under it's own name, not as "check" Pavel Roskin
@ 2006-11-03 22:17 ` Pavel Roskin
  2006-11-03 22:17 ` [PATCH 3/4] Add support for __builtin_strpbrk() Pavel Roskin
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Pavel Roskin @ 2006-11-03 22:17 UTC (permalink / raw)
  To: linux-sparse

From: Pavel Roskin <proski@gnu.org>

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 Makefile |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index da4a47a..61c7953 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,7 @@ CFLAGS += -DDEBUG
 PREFIX=$(HOME)
 BINDIR=$(PREFIX)/bin
 PROGRAMS=test-lexing test-parsing obfuscate compile graph sparse test-linearize example test-unssa test-dissect
+INST_PROGRAMS=sparse cgcc
 
 LIB_H=    token.h parse.h lib.h symbol.h scope.h expression.h target.h \
 	  linearize.h bitmap.h ident-list.h compat.h flow.h allocate.h \
@@ -39,8 +40,10 @@ LIBS=$(LIB_FILE)
 
 all: $(PROGRAMS) $(SLIB_FILE)
 
-install: sparse $(SLIB_FILE) bin-dir
-	if test $< -nt $(BINDIR)/sparse ; then install -v $< $(BINDIR)/sparse ; install -v $(SLIB_FILE) $(BINDIR) ; fi
+install: $(INST_PROGRAMS) $(SLIB_FILE) bin-dir
+	for f in $(INST_PROGRAMS) $(SLIB_FILE); do \
+		install -v $$f $(BINDIR)/$$f || exit 1; \
+	done
 
 bin-dir:
 	@if ! test -d $(BINDIR); then \

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

* [PATCH 3/4] Add support for __builtin_strpbrk()
  2006-11-03 22:16 [PATCH 1/4] Compile sparse executable under it's own name, not as "check" Pavel Roskin
  2006-11-03 22:17 ` [PATCH 2/4] Install cgcc on "make install", refactor installation code Pavel Roskin
@ 2006-11-03 22:17 ` Pavel Roskin
  2006-11-03 22:17 ` [PATCH 4/4] Typo fixes Pavel Roskin
  2006-11-06 18:50 ` [PATCH 1/4] Compile sparse executable under it's own name, not as "check" Josh Triplett
  3 siblings, 0 replies; 6+ messages in thread
From: Pavel Roskin @ 2006-11-03 22:17 UTC (permalink / raw)
  To: linux-sparse

From: Pavel Roskin <proski@gnu.org>

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 lib.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib.c b/lib.c
index 81e756d..3f753f0 100644
--- a/lib.c
+++ b/lib.c
@@ -479,6 +479,7 @@ void declare_builtin_functions(void)
 	add_pre_buffer("extern char *__builtin_strncpy(char *, const char *, __SIZE_TYPE__);\n");
 	add_pre_buffer("extern __SIZE_TYPE__ __builtin_strspn(const char *, const char *);\n");
 	add_pre_buffer("extern __SIZE_TYPE__ __builtin_strcspn(const char *, const char *);\n");
+	add_pre_buffer("extern char * __builtin_strpbrk(const char *, const char *);\n");
 
 	/* And some random ones.. */
 	add_pre_buffer("extern void *__builtin_return_address(unsigned int);\n");

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

* [PATCH 4/4] Typo fixes
  2006-11-03 22:16 [PATCH 1/4] Compile sparse executable under it's own name, not as "check" Pavel Roskin
  2006-11-03 22:17 ` [PATCH 2/4] Install cgcc on "make install", refactor installation code Pavel Roskin
  2006-11-03 22:17 ` [PATCH 3/4] Add support for __builtin_strpbrk() Pavel Roskin
@ 2006-11-03 22:17 ` Pavel Roskin
  2006-11-06 18:50 ` [PATCH 1/4] Compile sparse executable under it's own name, not as "check" Josh Triplett
  3 siblings, 0 replies; 6+ messages in thread
From: Pavel Roskin @ 2006-11-03 22:17 UTC (permalink / raw)
  To: linux-sparse

From: Pavel Roskin <proski@gnu.org>

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 evaluate.c                                   |    2 +-
 example.c                                    |    4 ++--
 expand.c                                     |    2 +-
 inline.c                                     |    2 +-
 memops.c                                     |    2 +-
 pre-process.c                                |    2 +-
 simplify.c                                   |    2 +-
 symbol.c                                     |    2 +-
 validation/initializer-entry-defined-twice.c |    2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/evaluate.c b/evaluate.c
index 6fb6be2..ca49ed0 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -1475,7 +1475,7 @@ static struct symbol *evaluate_dereferen
 
 	switch (ctype->type) {
 	default:
-		sparse_error(expr->pos, "cannot derefence this type");
+		sparse_error(expr->pos, "cannot dereference this type");
 		return NULL;
 	case SYM_PTR:
 		node->ctype.modifiers = target->ctype.modifiers & MOD_SPECIFIER;
diff --git a/example.c b/example.c
index 7e30c22..7c2bae3 100644
--- a/example.c
+++ b/example.c
@@ -942,7 +942,7 @@ static void generate_commutative_binop(s
 	if (!is_dead_reg(state, src1, reg1))
 		goto do_switch;
 
-	/* Both are dead. Is one preferrable? */
+	/* Both are dead. Is one preferable? */
 	if (reg2 != preferred_reg(state, insn->target))
 		goto dont_switch;
 
@@ -1493,7 +1493,7 @@ static void write_reg_to_storage(struct
 
 		/* Fall back on stack allocation ... */
 		alloc_stack(state, storage);
-		/* Fallthroigh */
+		/* Fallthrough */
 	default:
 		output_insn(state, "movl %s,%s", reg->name, show_memop(storage));
 		return;
diff --git a/expand.c b/expand.c
index a34d07d..90f7f36 100644
--- a/expand.c
+++ b/expand.c
@@ -562,7 +562,7 @@ static int expand_dereference(struct exp
 	/*
 	 * NOTE! We get a bogus warning right now for some special
 	 * cases: apparently I've screwed up the optimization of
-	 * a zero-offset derefence, and the ctype is wrong.
+	 * a zero-offset dereference, and the ctype is wrong.
 	 *
 	 * Leave the warning in anyway, since this is also a good
 	 * test for me to get the type evaluation right..
diff --git a/inline.c b/inline.c
index 81530d1..77adfab 100644
--- a/inline.c
+++ b/inline.c
@@ -428,7 +428,7 @@ static struct statement *copy_one_statem
 }
 
 /*
- * Copy a stateemnt tree from 'src' to 'dst', where both
+ * Copy a statement tree from 'src' to 'dst', where both
  * source and destination are of type STMT_COMPOUND.
  *
  * We do this for the tree-level inliner.
diff --git a/memops.c b/memops.c
index 8fd777d..bdecf14 100644
--- a/memops.c
+++ b/memops.c
@@ -69,7 +69,7 @@ found_dominator:
  * we can no longer really use "container()" to get from a user to
  * the instruction that uses it.
  *
- * This happens to work, simply because the likelyhood of the
+ * This happens to work, simply because the likelihood of the
  * (possibly non-instruction) containing the right bitpattern
  * in the right place is pretty low. But this is still wrong.
  *
diff --git a/pre-process.c b/pre-process.c
index 08d1a2e..81a535e 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -630,7 +630,7 @@ static int already_tokenized(const char
 	return 0;
 }
 
-/* Hande include of header files.
+/* Handle include of header files.
  * The relevant options are made compatible with gcc. The only options that
  * are not supported is -withprefix and friends.
  *
diff --git a/simplify.c b/simplify.c
index 495f5d3..a8b736b 100644
--- a/simplify.c
+++ b/simplify.c
@@ -550,7 +550,7 @@ offset:
 
 /*
  * We walk the whole chain of adds/subs backwards. That's not
- * only more efficient, but it allows us to find looops.
+ * only more efficient, but it allows us to find loops.
  */
 static int simplify_memop(struct instruction *insn)
 {
diff --git a/symbol.c b/symbol.c
index 6c91112..a9b26b5 100644
--- a/symbol.c
+++ b/symbol.c
@@ -360,7 +360,7 @@ static struct symbol *examine_pointer_ty
 	 * We need to set the pointer size first, and
 	 * examine the thing we point to only afterwards.
 	 * That's because this pointer type may end up
-	 * being needed for the base type size evalutation.
+	 * being needed for the base type size evaluation.
 	 */
 	if (!sym->bit_size)
 		sym->bit_size = bits_in_pointer;
diff --git a/validation/initializer-entry-defined-twice.c b/validation/initializer-entry-defined-twice.c
index 80434f1..58f314b 100644
--- a/validation/initializer-entry-defined-twice.c
+++ b/validation/initializer-entry-defined-twice.c
@@ -29,7 +29,7 @@ struct has_union union_error = {
 };
 
 /* Empty structures can make two fields have the same offset in a struct.
- * Initialzing both should not trigger the warning. */
+ * Initializing both should not trigger the warning. */
 struct empty { };
 
 struct same_offset {

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

* Re: [PATCH 1/4] Compile sparse executable under it's own name, not as "check"
  2006-11-03 22:16 [PATCH 1/4] Compile sparse executable under it's own name, not as "check" Pavel Roskin
                   ` (2 preceding siblings ...)
  2006-11-03 22:17 ` [PATCH 4/4] Typo fixes Pavel Roskin
@ 2006-11-06 18:50 ` Josh Triplett
  2006-11-06 23:58   ` Pavel Roskin
  3 siblings, 1 reply; 6+ messages in thread
From: Josh Triplett @ 2006-11-06 18:50 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-sparse

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

I've applied this series of four patches; thanks.

Your "typo fixes" patch also reminded me that I needed to fix the typo in the
name of "validation/bad-assignement.c", which I have now done.

Regarding your comment about using "make check" for something more useful, I
would greatly welcome a patch which actually checked sparse against all the
files in validation/ and tested what those files intended to test.  As far as
I can tell, it looks like some of them may not work as intended right now; for
example, it looks like validation/builtin_safe1.c expects
__attribute__((pure)) and __attribute__((const)) to work and mark a function
as side-effect-free, which doesn't currently happen in sparse.

- Josh Triplett



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

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

* Re: [PATCH 1/4] Compile sparse executable under it's own name, not as "check"
  2006-11-06 18:50 ` [PATCH 1/4] Compile sparse executable under it's own name, not as "check" Josh Triplett
@ 2006-11-06 23:58   ` Pavel Roskin
  0 siblings, 0 replies; 6+ messages in thread
From: Pavel Roskin @ 2006-11-06 23:58 UTC (permalink / raw)
  To: Josh Triplett; +Cc: linux-sparse

Hi Josh,

On Mon, 2006-11-06 at 10:50 -0800, Josh Triplett wrote:
> Regarding your comment about using "make check" for something more useful, I
> would greatly welcome a patch which actually checked sparse against all the
> files in validation/ and tested what those files intended to test.  As far as
> I can tell, it looks like some of them may not work as intended right now; for
> example, it looks like validation/builtin_safe1.c expects
> __attribute__((pure)) and __attribute__((const)) to work and mark a function
> as side-effect-free, which doesn't currently happen in sparse.

I've just mailed a very primitive testsuite.

I would prefer to have a test list and lists for "should be bad" and
"known to fail", but it would have to use double loops or some shell
tricks (e.g. using environment variables as a hash), so I opted for the
simplest approach for now.

By the way, I'm not sure how to distinguish sparse errors from sparse
warnings short of grepping stderr.  For now, any stderr output is an
error.

-- 
Regards,
Pavel Roskin

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

end of thread, other threads:[~2006-11-06 23:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-03 22:16 [PATCH 1/4] Compile sparse executable under it's own name, not as "check" Pavel Roskin
2006-11-03 22:17 ` [PATCH 2/4] Install cgcc on "make install", refactor installation code Pavel Roskin
2006-11-03 22:17 ` [PATCH 3/4] Add support for __builtin_strpbrk() Pavel Roskin
2006-11-03 22:17 ` [PATCH 4/4] Typo fixes Pavel Roskin
2006-11-06 18:50 ` [PATCH 1/4] Compile sparse executable under it's own name, not as "check" Josh Triplett
2006-11-06 23:58   ` Pavel Roskin

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).