This patch addresses an issue I found while playing around with
228f8454d197b46b460a1b9ebfda7fa08d546c17, where an invocation of csc
combining named input files with stdin causes csc to try to compile
to "-.c":

  $ csc - file2.scm < file1.scm  

  Error: invalid argument to `.c' option
  
  Error: shell command terminated with non-zero exit status 256: 
/home/efh/chickens/git/bin/chicken - -output-file -.c

It's unclear to me what the right thing to do in this case is, and
anything more involved would mean a more invasive patch, so this one
simply disallows combining the two. If there's a better approach, please
take it :)

Evan
>From 76b0f3cc80805515eef8be044d3abe1f592ad66e Mon Sep 17 00:00:00 2001
From: Evan Hanson <ev...@thunktastic.com>
Date: Thu, 11 Oct 2012 22:34:21 -0500
Subject: [PATCH] disallow compiling from both stdin & named files

---
 csc.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/csc.scm b/csc.scm
index b067c4e..f25a4f0 100644
--- a/csc.scm
+++ b/csc.scm
@@ -550,6 +550,8 @@ EOF
                        (if shared
                            (pathname-replace-extension f0 
shared-library-extension)
                            (pathname-replace-extension f0 
executable-extension) ) ) ) ) ]
+                [(and (member "-" scheme-files) (> (length scheme-files) 1))
+                 (quit "cannot compile from standard input with named files")]
                 [else
                  (when (and shared (not embedded))
                    (set! translate-options (cons "-dynamic" 
translate-options)) )
-- 
1.7.12.1

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to