From: Vibhu M. <vi...@ho...> - 2022-09-25 01:40:44
|
Hi, I've found and fixed a problem in lispbibl.d. I've attached an indicative diff of the C file. System: Windows 10, a fresh Cygwin, and the latest GitLab clisp. I followed the instructions in INSTALL.windows ("3. Binaries for the Cygwin environment"), for 64-bit binaries. Besides the prescribed configure options, I added --ignore-absence-of-libsigsegv. Make fails to produce spvw.o because lispbibl.c does this near line 1900: #define CR 13 and then #includes a file (unix.c) that ultimate #includes /usr/include/w32api/winnt.h which itself has a legitimate symbol (not macro) named CR that gets replaced by 13 resulting in a syntax error. My fix is to move the whole #define block a few lines down to after the #include block. That prevents the #define macros from inadvertently capturing symbols from the included files. ---- I'm not an expert C programmer, but this technique of #including a file after #defining a macro seems wrong in general. It makes changing the included file impossibly hard as its author isn't free to use any new symbols without fearing that an includer like clisp will capture them. If clisp files followed a rule of never allowing #includes to follow #defines, but to only ever precede them, I think that would consistently prevent this particular sort of variable capture regardless of the depth of an include hierarchy. An alternative prevention would be if include file authors only created symbols with some namespace prefix, though that would make their code unreadable. With best wishes, Vibhu |