Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Patch for VS.Net 2005's strxfrm() bug

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: andrew(at)dunslane(dot)net
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Hiroshi Saito <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, pgsql-hackers(at)postgresql(dot)org, William ZHANG <uniware(at)zedware(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Patch for VS.Net 2005's strxfrm() bug
Date: 2006-07-27 00:56:02
Message-ID: 44C80F22.8050704@phlo.org (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
andrew(at)dunslane(dot)net wrote:
>> Bruce Momjian wrote:
>>>>> Why is this better than:
>>>>>
>>>>>   #if _MSC_VER == 1400
>>>>>
>>>>> Surely this will not be true if _MSC_VER is undefined?
>>>> I experienced injustice and the reason of in OSX for it.
>>> What was the problem with OSX?  Did it throw a warning of you did an
>>> equality test on an undefined symbol?
>> The following if evaluated to true on osx, although I'm pretty sure that
>> _MSC_VER isn't defined on osx ;-)
>> #if (_MSC_VER < 1300)
>> ...
>> #endif
>>
>> replacing it with
>> #ifdef WIN32
>> #if (_MSC_VER < 1300)
>> ...
>> #endif
>> #endif
>>
>> fixed the problem.
> 
> No doubt, but that's quite a different test.
I mainly posted this to show what the offending ifdef in pgadmin3 looked like,
since someone referenced it, not as an argument against "#if _MSC_VER = 1400".

I guess "_MSC_VER < 1300" gets interpreted as "0 < 1300" if _MSC_VER is undefined,
so "_MSC_VER = 1400" would actually work.

But it still suprised me a lot that "_MSC_VER < 1300" evaluated to true if _MSC_VER
is undefined - maybe thats the _real_ reason why some people don't like the tri-state
logic in sql - it's because they get confused when trying to use the c preprocessor ;-)

greetings, Florian Pflug


In response to

pgsql-hackers by date

Next:From: Qingqing ZhouDate: 2006-07-27 01:28:12
Subject: Re: default lower case of identifier
Previous:From: Hiroshi SaitoDate: 2006-07-27 00:56:01
Subject: Re: [HACKERS] Patch for VS.Net 2005's strxfrm() bug

pgsql-patches by date

Next:From: Tatsuo IshiiDate: 2006-07-27 06:00:22
Subject: pgbench patches
Previous:From: Hiroshi SaitoDate: 2006-07-27 00:56:01
Subject: Re: [HACKERS] Patch for VS.Net 2005's strxfrm() bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group