From 7e63eaf3eb18e5c805b856d7dbbd905e0d3e79ea Mon Sep 17 00:00:00 2001 From: Marius Gerbershagen Date: Tue, 24 Mar 2026 19:49:45 +0100 Subject: [PATCH] cmp: fix compilation of empty file This regressed after commit ede2f0aaa194ada48525f13a5aa2e3773d8c0143 --- src/cmp/cmpbackend-cxx/cmppass2-top.lsp | 14 +++++++------- src/tests/normal-tests/compiler.lsp | 11 +++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/cmp/cmpbackend-cxx/cmppass2-top.lsp b/src/cmp/cmpbackend-cxx/cmppass2-top.lsp index 782766358..0329afe12 100644 --- a/src/cmp/cmpbackend-cxx/cmppass2-top.lsp +++ b/src/cmp/cmpbackend-cxx/cmppass2-top.lsp @@ -132,13 +132,13 @@ (wt-nl-h "#define VV NULL")) (progn (wt-nl-h "#define VM " (data-permanent-storage-size)) - (wt-nl-h "#define VMtemp " (data-temporary-storage-size))))) - ;; VV might be needed by functions in CLINES. - (wt-nl-h "# ifdef ECL_DYNAMIC_VV") - (wt-nl-h "static cl_object *VV;") - (wt-nl-h "# else") - (wt-nl-h "static cl_object VV[VM];") - (wt-nl-h "# endif") + (wt-nl-h "#define VMtemp " (data-temporary-storage-size)) + ;; VV might be needed by functions in CLINES. + (wt-nl-h "# ifdef ECL_DYNAMIC_VV") + (wt-nl-h "static cl_object *VV;") + (wt-nl-h "# else") + (wt-nl-h "static cl_object VV[VM];") + (wt-nl-h "# endif")))) ;; (wt-nl-h "#define ECL_DEFINE_SETF_FUNCTIONS ") (loop for (name setf-vv name-vv) in *setf-definitions* diff --git a/src/tests/normal-tests/compiler.lsp b/src/tests/normal-tests/compiler.lsp index 5a3d9dce8..d425602c6 100644 --- a/src/tests/normal-tests/compiler.lsp +++ b/src/tests/normal-tests/compiler.lsp @@ -2701,3 +2701,14 @@ (delete-file ofile) (is (equal (concatenate 'string part-1 part-2) *nested-eval-when-0114*)))) + +;;; Date 2026-03-24 +;;; Description +;;; +;;; Check that we can compile an empty file +;;; +(test cmp.0115.empty-file + (let* ((ofile + (with-compiler ("empty-file-0115.lsp" :load t)))) + (delete-file "empty-file-0115.lsp") + (delete-file ofile)))