[Gllug] Website developement

Stig Brautaset stig at brautaset.org
Sun Jul 15 18:36:58 UTC 2001


Nix <nix at esperi.demon.co.uk> writes:

> On Sat, 14 Jul 2001, David Freeman uttered the following:
> >  --- Stig Brautaset <stig at brautaset.org> wrote: > David Freeman
> > <freemadi at yahoo.co.uk> writes:
> >> for on my webpage.  I use gcc's preprocessor to merge a template
> 
> Oh, no...
> 
> >> holding the layout and link bit, and a file for holding the actual
> >> Have a look at http://www.brautaset.org/config.htm to get an idea. 
> >> Feel free to email me with questions.
> > 
> > You are a genius! I wish I had thought of it, and I had spent so long
> > peeing about with the preprocessor all day as well! 
> > 
> > If we ever meet I owe you a pint!
> > 
> > gcc and make solve yet another problem!
> 
> This is one that they are not supposed to solve. The C preprocessor
> can only sensibly handle C; any attempt to make it handle anything
> else (like Makefiles, hello imake, or X resources files) is a
> mistake.
> 
> You will find oddities happening, like the string `i586' collapsing
> to `1' in the expanded page;

Yes, I am aware of that.

I do not often use defined C/C++ keywords on my webpage, so this
problem is easily avoided by putting "#undef linux" (or whatever
keyword you need to write) somewhere in the file included. Simple.

And yes, other problems like having to use " instead of " in the
source file, but you are supposed to do that anyway, so I really do
not see it as a problem. 

> it Just Won't Work like you want it to.

Speak for yourself; it does *exactly* what I need. 

> (In fact, as of GCC-3.0, it won't work at all; `cpp -traditional' will
> work better than nothing --- that was kept working for the sake of
> imake.)

I have gcc 2.95.4 (how it relates to 3.0 I don't know, but it can't be
*that* far off) and that works like a charm.

> Consider that transformation of a source file into tokens happens
> *before* preprocessing; the preprocessor operates on a stream of C
> tokens, *not* on text.

Last time I checked, C is written using ascii characters; the same as
english text.

> If you want a generalized macro expander, use M4. It has many, many
> advantages over cpp for this sort of thing;

I agree that it might be a better solution for this task, but then I
had to learn yet another tool. M4 is not something I have an interest
in learning.

> Using make is fine. Using cpp is a horrible mistake.

It works fine for me; it simplifies the making of my webpage, and htat
is really all that I ask. In addition I get some experience with make
and gcc, which I consider a plus.

Cheers, Stig
-- 
 19:23:34 up 21:03,  4 users,  load average: 0.11, 0.07, 0.02

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list