andrzej zaborowski writes ("Re: [Qemu-devel] Re: [PATCH] Add support for a 
configuration file"):
> What I'd love, though, but expect others will consider bloat, is that
> files are passed through cpp before interpreting.

cpp is a terrible preprocessor.  It mostly works for C source code
(although it has some serious deficiences there - for example, that
you can't have macros that generate macros).  But for anything whose
lexical structure is not much like C it causes terrible trouble -
randomly inserting spaces, need for explicit token pasting (dependent
on the C operator set), etc.  It breaks even something as simple as
#-comments, which are obviously what we would want in our plain text
config file.

If you really want a preprocessor, use m4 (one that supports -p and
using a suitable m4_changequote).  m4 isn't particularly pretty but it
doesn't interfere with the core of the syntax.

Better, make the configuration defaults sufficiently good that it is
not necessary to reproduce lots of boilerplate to get things done.
Then macros aren't needed for human-written files - and of course
program-written config files can don't need a macro system anyway.

Ian.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to