Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Sep 2001 14:29:00 -0700 (PDT)
From:      Archie Cobbs <archie@dellroad.org>
To:        freebsd-questions@freebsd.org
Subject:   gcc -D flag
Message-ID:  <200109012129.f81LT0M54076@arch20m.dellroad.org>

next in thread | raw e-mail | index | archive | help
Can someone tell me what I'm missing here?

    $ cat > foo.c
    int main(int ac, char **av) { return 0; }
    #if FOO == BAR
    #error
    #endif
    $ cc -o foo -Wall -DFOO=BAR foo.c
    foo.c:3: #error 
    $ cc -o foo -Wall foo.c
    foo.c:3: #error 
    $ cc -o foo -Wall -DFOO=NOTBAR foo.c
    foo.c:3: #error 

Seems like #if FOO == BAR is being evalutated as true no matter what.

This is with FreeBSD 4.3-REL, gcc 2.95.3.

-Archie

__________________________________________________________________________
Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109012129.f81LT0M54076>