~ chicken-core (chicken-5) ad323818809b1044969fb1032ac8c833508f912a


commit ad323818809b1044969fb1032ac8c833508f912a
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Fri Dec 17 17:42:19 2010 +0100
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Fri Dec 17 17:42:19 2010 +0100

    I'm fed up with it

diff --git a/batch-driver.scm b/batch-driver.scm
index c90f7465..502c7cc6 100644
--- a/batch-driver.scm
+++ b/batch-driver.scm
@@ -183,10 +183,8 @@
       (set! all-import-libraries #t))
     (set! enable-module-registration (not (memq 'no-module-registration options)))
     (when (memq 'lambda-lift options) (set! do-lambda-lifting #t))
-    (cond ((memq 'picky options)
-	   (set! do-scrutinize 'picky))
-	  ((memq 'scrutinize options)
-	   (set! do-scrutinize #t)))
+    (when (memq 'scrutinize options)
+      (set! do-scrutinize #t))
     (when (memq 't debugging-chicken) (##sys#start-timer))
     (when (memq 'b debugging-chicken) (set! time-breakdown #t))
     (when (memq 'emit-exports options)
diff --git a/c-platform.scm b/c-platform.scm
index 52001180..e95b68b4 100644
--- a/c-platform.scm
+++ b/c-platform.scm
@@ -88,7 +88,7 @@
     disable-stack-overflow-checks raw 
     emit-external-prototypes-first release local inline-global
     analyze-only dynamic scrutinize no-argc-checks no-procedure-checks
-    no-procedure-checks-for-toplevel-bindings module picky
+    no-procedure-checks-for-toplevel-bindings module
     no-bound-checks no-procedure-checks-for-usual-bindings no-compiler-syntax
     no-parentheses-synonyms no-symbol-escape r5rs-syntax emit-all-import-libraries
     setup-mode unboxing no-module-registration) )
diff --git a/compiler.scm b/compiler.scm
index d86e45d8..53747e53 100644
--- a/compiler.scm
+++ b/compiler.scm
@@ -1923,19 +1923,16 @@
 	   (set-real-name! (first (node-parameters (or value pvalue))) sym) )
 
 	 ;; If this is the first analysis and the variable is global and has no references
-	 ;;  then issue warning:
+	 ;;  and is hidden then issue warning:
 	 (when (and first-analysis 
 		    global
 		    (null? references)
-		    (not (variable-mark sym '##compiler#unused)))
-	   (when assigned-locally
-	     (##sys#notice 
-	      (sprintf "local assignment to unused variable `~S' may be unintended" sym) ) )
-	   (when (and (not (variable-visible? sym))
-		      (not (variable-mark sym '##compiler#constant)) )
-	     (##sys#notice 
-	      (sprintf "global variable `~S' is only locally visible and never used"
-		sym) ) ) )
+		    (not (variable-mark sym '##compiler#unused))
+		    (not (variable-visible? sym))
+		    (not (variable-mark sym '##compiler#constant)) )
+	   (##sys#notice 
+	    (sprintf "global variable `~S' is only locally visible and never used"
+	      sym) ) )
 
  	 ;; Make 'boxed, if 'assigned & 'captured:
 	 (when (and assigned captured)
diff --git a/csc.scm b/csc.scm
index 692567f4..d74247a8 100644
--- a/csc.scm
+++ b/csc.scm
@@ -139,7 +139,7 @@
     -no-symbol-escape -no-parentheses-synonyms -r5rs-syntax
     -no-argc-checks -no-bound-checks -no-procedure-checks -no-compiler-syntax
     -emit-all-import-libraries -setup-mode -unboxing -no-elevation -no-module-registration
-    -no-procedure-checks-for-usual-bindings -module -picky
+    -no-procedure-checks-for-usual-bindings -module
     -no-procedure-checks-for-toplevel-bindings))
 
 (define-constant complex-options
@@ -357,7 +357,6 @@ Usage: #{csc} FILENAME | OPTION ...
     -profile-name FILENAME         name of the generated profile information
                                     file
     -S  -scrutinize                perform local flow analysis
-    -picky                         perform more static checks (implies -scrutinize)
     -types FILENAME                load additional type database
 
   Optimization options:
diff --git a/manual/Using the compiler b/manual/Using the compiler
index 62a1fc0f..b1c22629 100644
--- a/manual/Using the compiler	
+++ b/manual/Using the compiler	
@@ -166,8 +166,6 @@ the source text should be read from standard input.
 
 ; -output-file FILENAME : Specifies the pathname of the generated C file. Default is {{FILENAME.c}}.
 
-; -picky : like {{-scrutinize}} but enables more static checks.
-
 ; -postlude EXPRESSIONS : Add {{EXPRESSIONS}} after all other toplevel expressions in the compiled file.  This option may be given multiple times. Processing of this option takes place after processing of {{-epilogue}}.
 
 ; -prelude EXPRESSIONS : Add {{EXPRESSIONS}} before all other toplevel expressions in the compiled file.  This option may be given multiple times. Processing of this option takes place before processing of {{-prologue}}.
diff --git a/scrutinizer.scm b/scrutinizer.scm
index 802bfd78..e83a63ef 100755
--- a/scrutinizer.scm
+++ b/scrutinizer.scm
@@ -547,19 +547,6 @@
 		  (always-true rt loc n)
 		  (let ((r1 (walk c e loc dest tail))
 			(r2 (walk a e loc dest tail)))
-		    ;;XXX this could also check for noreturn (same as undefined)
-		    (when (and tail
-			       (eq? 'picky do-scrutinize)
-			       (<= (length loc) 1)
-			       (if (eq? '##core#undefined (node-class c))
-				   (and (not (eq? '##core#undefined (node-class a)))
-					(not (self-call? a loc)))
-				   (and (eq? '##core#undefined (node-class a))
-					(not (self-call? c loc)))))
-		      (report
-		       loc
-		       (sprintf "conditional in tail-position has branch with undefined result:~%~%~a"
-			 (pp-fragment n))))
 		    (cond ((and (not (eq? '* r1)) (not (eq? '* r2)))
 			   (when (and (not (any noreturn-type? r1))
 				      (not (any noreturn-type? r2))
diff --git a/tests/runtests.sh b/tests/runtests.sh
index e2e40c19..61a8c61d 100644
--- a/tests/runtests.sh
+++ b/tests/runtests.sh
@@ -60,7 +60,7 @@ $compile inlining-tests.scm -optimize-level 3
 ./a.out
 
 echo "======================================== scrutiny tests ..."
-$compile scrutiny-tests.scm -scrutinize -picky -analyze-only -ignore-repository -types ../types.db 2>scrutiny.out
+$compile scrutiny-tests.scm -scrutinize -analyze-only -ignore-repository -types ../types.db 2>scrutiny.out
 
 if test -n "$MSYSTEM"; then
     dos2unix scrutiny.out
diff --git a/tests/scrutiny.expected b/tests/scrutiny.expected
index 791808da..cd3a5bc4 100644
--- a/tests/scrutiny.expected
+++ b/tests/scrutiny.expected
@@ -45,9 +45,4 @@ Warning: at toplevel:
 Warning: at toplevel:
   g89: in procedure call to `g89', expected a value of type `(procedure () *)', but were given a value of type `fixnum'
 
-Warning: in toplevel procedure `foo':
-  conditional in tail-position has branch with undefined result:
-
-(if bar23 '3 (##core#undefined))
-
 Warning: redefinition of standard binding: car
Trap