Mail Archives: djgpp-workers/2011/08/23/04:03:49
Hi,
On Sat, Aug 20, 2011 at 11:41 PM, Eli Zaretskii <eliz AT gnu DOT org> wrote:
>>
>> I'm the worst person to comment on this, but ... if __STDC__ means
>> ANSI/ISO C89/C90/C99, then lacking that, K&R C won't have _Complex
>> (C99) keyword anyways.
>
> _Complex is a GCC extension, so it's always available.
Okay, I didn't know that.
> I don't know if someone can define _Complex in another compiler
But I'm fairly?? certain that most other compilers aren't trying to
use (or esp. rebuild) DJGPP's libc. Okay, so I did encounter Detlef
Reimer's "build" of LCC 4.2 for DOS recently, and he does use DJGPP
libc (2.01, heh) and heavily modified headers. I think it's a pure
ANSI C89 compiler, so I doubt it supports _Complex. Honestly, I would
be surprised if anybody only supported _Complex but not the more
useful, common stuff from C99.
Anyways, like I said, LCC is ANSI (C89) and was only intended to use,
not rebuild, DJGPP's libc, hence it doesn't require old-style K&R nor
_Complex.
> or undef __STDC__
> with GCC (with some std= switch), but I don't like gratuitous changes
> in someone else's code.
I don't like changes either, esp. ones that aren't tested or could
break. You've got a point there. And clearly I defer to your massive
experience.
I dug up GCC 2.95.3 info files, which (to me) is oldest still relevant
GCC. I didn't test _Complex, but it did have very preliminary "c9x"
[sic] support. From what it says, __STDC__ is always defined unless
you use "-traditional".
Does newer GCC even support "-traditional"? I didn't think so, but I
can't remember without double-checking. Hmmm, latest docs online say
this:
"GCC versions 3.2 and later only support traditional mode semantics in
the preprocessor, and not in the compiler front ends."
In short, I know I'm overthinking this, and it's not that crucial,
just saying ... I'm all for compatibility and checks and being
conservative and leaving code "just in case", but I don't think it's a
realistic case here in particular.
- Raw text -