qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH] Add support for a configuration file


From: Ian Jackson
Subject: Re: [Qemu-devel] Re: [PATCH] Add support for a configuration file
Date: Thu, 15 May 2008 15:58:49 +0100

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]