[Autogen-users] --select-suffix (kind of) breaks header-file macro
Brought to you by:
bkorb
From: Dennis W. <dw...@ma...> - 2010-12-13 14:55:24
|
Hi Bruce, hi list, FYI a small gotcha I stumbled over today: Suppose I have a template file that produces both foo.c and foo.h, and says #include "[+ (. header-file) +]" somewhere. This will nicely expand to #include "foo.h" in the usual cases. If I issue --select-suffix=c though, because I do not want to regenerate foo.h right now, it expands to #include "/dev/null" which is pretty irritating (and betrays the option's implementation :) A workaround is to use #include "[+ (string-substitute (out-name) ".c" ".h") +]" instead. I am not saying this is a bug that needs fixing, but IMO it does somewhat violate the "least-surprise" principle. Cheers, Dennis |