Re: src/tools/msvc usage instructions

From: "Chuck McDevitt" <cmcdevitt(at)greenplum(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: src/tools/msvc usage instructions
Date: 2006-10-03 16:16:46
Message-ID: EB48EBF3B239E948AC1E3F3780CF8F880109C957@MI8NYCMAIL02.Mi8.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From my experience with Visual C++, using /Za isn't a good idea.
When you set that, the compiler become very pedantic about following the
ANSI speck to the letter, which usually means common posix functions
aren't available under their normal names (The ansi spec says if the
compiler defines functions beyond what in the spec, it's recommended
they start with "_" to not conflict with application name space).
Compatibility with GCC is reduced when you use /Za.

-----Original Message-----
From: pgsql-hackers-owner(at)postgresql(dot)org
[mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
Sent: Tuesday, October 03, 2006 8:51 AM
To: Magnus Hagander
Cc: Jeremy Drake; PostgreSQL Hackers
Subject: Re: [HACKERS] src/tools/msvc usage instructions

"Magnus Hagander" <mha(at)sollentuna(dot)net> writes:
>> which looks like they figured out that they needed to check
>> for MicroSoft C explicitly. I have no idea why they do not
>> define __STDC__ however.

> Can we just define __STDC__ when compiling that file (or rather, when
> compiling any bison-generated output file)? Or is that likely to cause
> *other* issues?

That seems pretty risky. Better to use the /Za switch or whatever it
was to get the compiler to assert it for itself. We have precedent for
adding yes-we'd-like-a-standard-compiler-please switches where
necessary, for instance adding -Ae to CFLAGS for HP's compiler.

regards, tom lane

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-10-03 16:17:18 Re: 7.4, 8.0 branches @ itanium2 & icc
Previous Message Andrew Dunstan 2006-10-03 16:13:46 Re: timestamptz alias