This is the mail archive of the
mailing list for the Cygwin project.
Re: gcc/ansi question
- To: cygwin-apps at cygwin dot com
- Subject: Re: gcc/ansi question
- From: Earnie Boyd <earnie_boyd at yahoo dot com>
- Date: Wed, 02 May 2001 09:22:00 -0400
- References: <20010501231814.A26391@redhat.com>
- Reply-To: Cygwin Apps <cygwin-apps at cygwin dot com>
Christopher Faylor wrote:
> It has been pointed out to me that I shouldn't be doing -Dunix when
> using the -ansi switch with gcc because the compiler should only define
> things which begin with an underscore. I can fix this easily.
> Does anyone know how MSVC handles the WIN32 definitions? Is there an
> equivalent switch for Windows which disables the definition of WIN32?
> My MSVC installation is currently hosed for some reason so I can't check
> this myself.
According to the "Microsoft Visual C++ Run-Time Library Reference" for
ANSI C COMPLIANCE
The naming convention for all Microsoft-specific identifiers in the
run-time system (such as functions, macros, constants, variables, and
type definitions) is ANSI-compliant. In this book, any run-time
function that follows the ANSI/ISO C standards is noted as being ANSI
compatible ANSI-compliant applications should only use these ANSI
The names of Microsoft-specific functions and global variables begin
with a single underscore. These names can be overridden only locally,
within the scope of your code. For example, when you include Microsoft
run-time header files, you can still locally override the
Microsoft-specific function names _open by declaring a local variable of
the same name. However, you cannot use this name for your own local
function or global variable.
The names of Microsoft-specific macros and manifest constants begin with
two underscores, or with a single leading underscore immediately
followed by an uppercase letter. The scope of these identifiers is
absolute. For example, you cannot use the Microsoft-specific identifier
_UPPER for this reason.
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com