[comp.sys.next] CC Bug discovered ?

ralf@reswi.ruhr.de (Ralf E. Stranzenbach) (06/27/91)

It's late, but it seems that I discovered a cc bug. One of my source
files contained a line as follows:

        # if defined(OSK) || defined(BSD)
        #  define DIRENT struct direct
        # else
        #  define DIRENT struct dirent
        # endif

But surprisingly this did NOT compile right. If I replace defined(BSD)
with defined(NeXT), everything works OK. Is this a CC / CPP bug or
simply an error in the NeXT documentation ?

        Ralf

-- 
Ralf E.Stranzenbach  -  ralf@reswi.ruhr.de  -  Fido: via 2:241/5800.12

sef@kithrup.COM (Sean Eric Fagan) (06/27/91)

("Distriution: comp" is invalid.  Please stop it.)
In article <1991Jun27.014104.17845@reswi.ruhr.de> ralf@reswi.ruhr.de (Ralf E. Stranzenbach) writes:
>It's late, but it seems that I discovered a cc bug. 

Very unlikely.

>If I replace defined(BSD)
>with defined(NeXT), everything works OK. Is this a CC / CPP bug or
>simply an error in the NeXT documentation ?

Well, it would indicate to me, with about, oh, less than a second's worth of
thought, that BSD is not defined by the system compiler.  If the
documentation says it is, and it isn't, then that is an error in the
documentation.  If you do a 'cc -v <whatever>', and there is a '-DBSD'
somewhere on the line shown for cpp, then, and only then, would I say that
it is a compiler (actually preprocessor) bug.

-- 
Sean Eric Fagan  | "What *does* that 33 do?  I have no idea."
sef@kithrup.COM  |           -- Chris Torek
-----------------+              (torek@ee.lbl.gov)
This article may not be distributed under any copyright without my consent.

ralf@reswi.ruhr.de (Ralf E. Stranzenbach) (06/28/91)

sef@kithrup.COM (Sean Eric Fagan) writes:

>In article <1991Jun27.014104.17845@reswi.ruhr.de> ralf@reswi.ruhr.de (Ralf E. Stranzenbach) writes:
>>It's late, but it seems that I discovered a cc bug. 

>Very unlikely.

>>If I replace defined(BSD)
>>with defined(NeXT), everything works OK. Is this a CC / CPP bug or
>>simply an error in the NeXT documentation ?

>Well, it would indicate to me, with about, oh, less than a second's worth of
>thought, that BSD is not defined by the system compiler.  If the
>documentation says it is, and it isn't, then that is an error in the
>documentation.  If you do a 'cc -v <whatever>', and there is a '-DBSD'
>somewhere on the line shown for cpp, then, and only then, would I say that
>it is a compiler (actually preprocessor) bug.

If the documentation say it is defined AND the system looks like bsd
the compiler should have the BSD Symbol defined. If it's undefined IT
IS A BUG.

Ralf
-- 
Ralf E.Stranzenbach  -  ralf@reswi.ruhr.de  -  Fido: via 2:241/5800.12