httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <Martin.Krae...@mch.sni.de>
Subject Re: [PATCH] Take2: Show compile time switches for server
Date Sun, 09 Nov 1997 12:00:44 GMT
On Fri, Nov 07, 1997 at 04:11:57PM -0800, Dean Gaudet wrote:
> #define X 1
> 
> #define S(x) S1(x)
> #define S1(x) #x
> 
> char *foo = S(X);

Oh, now I see why I had a problem... I tried it in a very similar
approach. But look at my compiler's output (the first is "almost ANSI",
the second "ANSI"):

    > cc -E deans-mac.c | tail -2
    char *foo = "X";
    #line 7

   > cc -kansi -E deans-mac.c | tail -2
    char *foo = "1";
    #line 7

Guess some compilers are on.y "conditionally compliant". Do you think
it's woth taking the risk and changing the function to pure ANSI? I have
the feeling that a more defensive approach would be better. :-(

    Martin
-- 
| S I E M E N S |  <Martin.Kraemer@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Mime
View raw message