Re: [PATCH] Quit compiling when an invalid import-Library declaration is encountered

2021-05-17 Thread Mario Domenech Goulart
On Fri, 23 Apr 2021 12:07:27 +1200 Evan Hanson  wrote:

> Thanks megane!
>
> On 2021-04-22 14:00, megane wrote:
>> ITYM it'll never trigger an error, even if the the filname is symbol for
>> example.
>
> In the use case where FILENAME is a string you will hit this:
>
> $ csc -analyze-only - < (declare (emit-import-library (foo "nope.import.scm")))
> (module foo *)
> EOF
> 
> Error: (string) bad argument type: "nope.import.scm"
>
> That's how I originally ran into this.
>
> But, now that you mention it, on closer inspection the validation for
> this declaration doesn't even have the intended effect since invalid
> specifications will cause # to be added to the alist of
> import libraries, leading to an error later in the compilation process:
>
> $ csc -analyze-only - < (declare (emit-import-library (foo nope.import.scm)))
> (module foo *)
> EOF
> 
> Warning: invalid import-library specification: (foo nope.import.scm)
> 
> Error: (assq) bad argument type: #
>
> Attached is a fix for *this* issue, in which we "quit-compiling" rather
> than warn when the declaration is invalid.
>
> Sorry I didn't notice this in the first place!

Thanks Evan and Megane.  I've pushed the patch.

All the best.
Mario
-- 
http://parenteses.org/mario



Re: [PATCH] Quit compiling when an invalid import-Library declaration is encountered

2021-04-22 Thread Evan Hanson
Imagine that last email had a nice descriptive subject, like this one.

Evan