Re: gcc 3 and the iostream debacle

[prev] [thread] [next] [lurker] [Date index for 2005/08/31]

From: Geoff Richards
Subject: Re: gcc 3 and the iostream debacle
Date: 18:49 on 31 Aug 2005
On Wed, Aug 31, 2005 at 08:17:41AM -0500, Peter da Silva wrote:
> >     #include <iostream>
> >     #include <iostream.h>
> 
> VAXC sometimes wanted things like
> 
> 	#include stdio
> 
> No quotes, no brackets, no extension.

You can do this, at least in GCC 4.0.2:

    #define stdio <stdio.h>
    ...

    #include stdio

Ugly.  The FreeType library uses this feature/hack to get the right
include files included, which is the only reason I discovered that it
was possible.  You do this sort of thing:

    #include <ft2build.h>
    #include FT_FREETYPE_H
    #include FT_GLYPH_H
    #include FT_OUTLINE_H
    #include FT_BBOX_H

I don't think I ever found out why you'd want to do it that way, but
there you are.

> This obviously made portable code a challenge. Particularly when
> TOPS-20 had a compiler that tokenized everything in the preprocessor
> so you couldn't ifdef it out.
> 
> Oh, and "$" and "@" were legal characters in identifiers.
> 
> I forget how I got around this. Maybe I didn't.

Nice.  So you could do tasteful things like this, at least if they
were allowed at the start of an identifier:

    int sum (int *@numbers, int $size)
    {
        int $total = 0;
        int $i;

        for ($i = 0; $i < $size; ++$i) {
            $total += @numbers[$i];
        }

        return $total;
    }

> Anyway, there's reasons I hate extensions to C. Let alone derived
> pseudo-object-oriented languages based on a design that had to work
> as a C preprocessor. I've modified C, adding new features, but only
> in play. Shipping code that implements or uses them is vile.
> 
> C++ is dead to me.

C++ was stillborn.

-- 

--- Geoff Richards -------------><-------------- http://ungwe.org/ ---
"I tried to fling my shadow at the moon,
 The while my blood leapt with a wordless song."  --  Theodore Roethke
There's stuff above here

Generated at 13:00 on 06 Sep 2005 by mariachi 0.52