Hello!

Attached is a patch for handling the case given in #1655 in a less
confusing way (by signalling an error).


felix
From fde79334d97bb230067880f80e36edca88755e33 Mon Sep 17 00:00:00 2001
From: felix <fe...@call-with-current-continuation.org>
Date: Tue, 19 Nov 2019 11:52:34 +0100
Subject: [PATCH] disallow using -c option in csc with multiple files.

Invoking csc with -c and multiple Scheme or C input files results
in any explicit output filenames given being ignored, since there
is an ambiguity for which object file the target filename applies.
C compilers disallow this altogether, so we follow suit.

See also #1655 for more information.
---
 csc.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/csc.scm b/csc.scm
index 60272816..5e5d6a16 100644
--- a/csc.scm
+++ b/csc.scm
@@ -570,6 +570,11 @@ EOF
             (when show-libs (print* (linker-libraries) #\space))
             (newline)
             (exit) )
+           (when (and compile-only 
+                      (> (+ (length scheme-files)
+                            (length c-files))
+                         1))
+             (stop "the `-c' option can not be used in combination with 
multiple input files"))
           (cond ((null? scheme-files)
                  (when (and (null? c-files)
                             (null? object-files))
-- 
2.21.0

Reply via email to