Op Sunday 02 March 2008 15:20:42 schreef Ralf Wildenhues: > Your rule is dangerous. If the user interrupts make at the time the > convertors.sh script has run but the backup hasn't been restored yet, > the source will be wrong, and the next time you may have duplicate > function definitions (or whatnot else the sed script then does given > the wrong input file). > Fortunately, the sed script only fires on things matching the patterns convertors(type); or convertors(type,display_name_of_type);, not on the expansion (which is a pair of normal C99 function definitions). If it did, the same issues would arise if the gcc couldn't compile the generated file.
I do like the option of using a different suffix, since it alerts any contributor that whatever is in there may, in certain areas, not be standard C. Also, it isolates any non-portability in the pre-processing process, allowing the C that is generated to be compiled portably. Avoiding any possible issues of macros that generate expansions that could be invocations of themselves is a side benefit, but welcome. Thanks for the help, Remco. P.S.: I've added a suffix rule for .cgen.c, invoking convertors.sh. So far, it seems to work. I'd like to take this opportunity to thank the automake developers for their work in producing a package that, combined with the other GNU build tools, seamlessly and effortlessly understands that rule and lets me include .cgen files as source files.
