This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] include _mingw.h in stddef.h
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Ross Ridge <rridge at csclub dot uwaterloo dot ca>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 18 Sep 2009 16:57:52 +0200
- Subject: Re: [PATCH] include _mingw.h in stddef.h
- References: <20090918144428.D95EC73F75@caffeine.csclub.uwaterloo.ca>
2009/9/18 Ross Ridge <rridge@csclub.uwaterloo.ca>:
> Dave Korn writes:
>> Well, yes, there's no reason why not, and if the MSVC compiler supplies
>>all these types built in I don't see why GCC shouldn't do just the same.
>
> The MinGW port of GCC isn't ment to be an MSVC++ clone, so you do really
> need better justification than just "Microsoft does it". ?There are lots
> of things the Micrsoft compiler does that GCC will never do. ?I don't
> think it's unreasonable for GCC to differ here, especially when there
> is a standard way of getting access to these types that works with
> both compilers.
>
> If support is added to GCC for these Microsoft types, I think it should
> be as real types. ?That would make the types fully compatibile with MSC.
> The macros defined in _mingw.h are really only ment for the private use
> of the MinGW runtime headers, and having GCC include it automatically
> would be a misuse of the header.
I agree that it would be best to have here builtin macros for those
type names. The builtin types aren't usable here, as they would be
typedefs and so not combinable with signed/unsigned. The macro version
doesn't work at the moment, too. The issue here is in C/C++ frontend
code by associating of attributes.
It shouled work to define as example 'int __attribute__ ((mode(DI)))'
as __int64 (to be noted it shouldn't be long long here, as this would
violate gcc's cX9 standard). But by use of this macro (eg unsigned
__int64 foo(unsigned __int64 a) { return a + 1; }, we get an error
message, as the attribute is bound to the function name and not to the
type as intended here.
So for now I see here just the possibilty to use USER_H (which would
break mingw.org, as they are using gcc's stddef.h and don't provide
their own), or to add here the _mingw.h include for handling this.
The latter has also the advantage that it is a bit more portable to
the old behavior.
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination