NO_EXT_KEYS and strict ISO/ANSI modes

From: Bart Oldeman (bartoldeman_at_NOSPAMusers.sourceforge.net)
Date: 04/30/04


Date: Thu, 29 Apr 2004 23:32:21 GMT

Hi,

Open Watcom C defines NO_EXT_KEYS if you use it with -za ("disable
extensions (i.e., accept only ISO/ANSI C)"), but isn't this a
contradiction in itself; it's not in the implementation defined namespace
after all.

This code for example

int foo(void)
{
  return NO_EXT_KEYS;
}

compiles happily. As far as I understand though this macro has been there
for a long time for MS compatibility so it can't be that easily removed.

My question is: do recent MS C compilers or other common compilers still
define this macro too? I just know that GCC doesn't -- it defines
__STRICT_ANSI__ instead.

We are considering to remove its definition from Open Watcom for the new
-za99 switch, well C99 support is far from complete but a switch similar
to GCC's -std=c99 is still needed.

Bart



Relevant Pages

  • Re: Hundreds of cases in a switch, optimization?
    ... > In terms of generated machine code, how does hundreds of cases in a switch ... Do compilers or processors do any ... extern int f; ... compiled both with and without optimisation. ...
    (comp.lang.c)
  • Re: I have a question
    ... int j = i; ... It is also considered a good thing to have code that is compilable with a C89 compiler, since very few C compilers are actually C99 compilers. ... That means declaring variables at the top of a block and not after executable statements. ...
    (comp.lang.c)
  • Re: va_arg and short
    ... > compilers. ... > That seemed a little strange to me, so I changed it to int and it compiled ... When you use the va_arg macro, the type that you supply must (with some ... _after default promotions_. ...
    (comp.lang.c)
  • Re: a little mistake
    ... Also the use of "inline" for that function is redundant. ... compilers will do it anyways and it isn't portable across all compilers ... int main ... Calling function would be part of the users code. ...
    (comp.lang.c)
  • Re: K&R-Style Function Declarations: Good or Bad?
    ... > short parameters getting promoted to int. ... all pre-ANSI compilers widened char and short ... declarations -- some compilers converted the widened types back to the ...
    (comp.lang.c)