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

2006-07-26 Thread Hiroshi Saito

From: "Florian G. Pflug"

Ahhh, It is right.!
I was retracing my memory for what situations the contents were. 
I was in distraction.It seems that it is satisfactory at the reason for ==.


Sorry and Thanks.!!

Regards,
Hiroshi Saito


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.

greetings, Florian Pflug



---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


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

2006-07-26 Thread Florian G. Pflug

[EMAIL PROTECTED] 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


---(end of broadcast)---
TIP 6: explain analyze is your friend


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

2006-07-26 Thread andrew
> 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.

cheers

andrew



---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


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

2006-07-26 Thread Florian G. Pflug

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.

greetings, Florian Pflug



---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


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

2006-07-26 Thread Bruce Momjian
Hiroshi Saito wrote:
> From: "Andrew Dunstan"
> 
> > Hiroshi Saito wrote:
> > > Hmm, It seems to be the bug of very unpleasant Microsoft.:D
> > > I think that the following is desirable as an evasion measure to add. 
> > >
> > > #if defined(_MSC_VER) && _MSC_VER == 1400
> > >
> > > To be sure, it was only VS2005.
> > >   
> > 
> > 
> > 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?

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


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

2006-07-25 Thread Hiroshi Saito
From: "Andrew Dunstan"

> Hiroshi Saito wrote:
> > Hmm, It seems to be the bug of very unpleasant Microsoft.:D
> > I think that the following is desirable as an evasion measure to add. 
> >
> > #if defined(_MSC_VER) && _MSC_VER == 1400
> >
> > To be sure, it was only VS2005.
> >   
> 
> 
> 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.

Regards,
Hiroshi Saito


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


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

2006-07-25 Thread Andrew Dunstan
Hiroshi Saito wrote:
> Hmm, It seems to be the bug of very unpleasant Microsoft.:D
> I think that the following is desirable as an evasion measure to add. 
>
> #if defined(_MSC_VER) && _MSC_VER == 1400
>
> To be sure, it was only VS2005.
>   


Why is this better than:

  #if _MSC_VER == 1400


Surely this will not be true if _MSC_VER is undefined?

cheers

andrew




---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


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

2006-07-25 Thread Hiroshi Saito
Hi.

"William ZHANG" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> When I tried to compile pgsql-8.2devel with VS.Net 2005 and do regression 
> tests,
> I found the problem. It's a bug inVS.Net 2005:
> http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99694
> 

+   /* 
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99694
 */
+ #if _MSC_VER == 1400
+   {
+char x[1];
+ 
+xfrmlen = strxfrm(x, val, 0);
+   }
+ #else
xfrmlen = strxfrm(NULL, val, 0);
+ #endif


Hmm, It seems to be the bug of very unpleasant Microsoft.:D
I think that the following is desirable as an evasion measure to add. 

#if defined(_MSC_VER) && _MSC_VER == 1400

To be sure, it was only VS2005.

Regards,
Hiroshi Saito


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


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

2006-07-25 Thread Tom Lane
"William ZHANG" <[EMAIL PROTECTED]> writes:
> When I tried to compile pgsql-8.2devel with VS.Net 2005 and do regression 
> tests,
> I found the problem. It's a bug inVS.Net 2005:
> http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99694

So why don't you use the fixed version of VS?

regards, tom lane

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq