[cfe-dev] Building Wine with clang on Mac OS X 10.6
Charles Davis
cdavis at mymail.mines.edu
Mon Oct 26 16:28:40 PDT 2009
Douglas Gregor wrote:
>
> On Oct 19, 2009, at 9:22 AM, Charles Davis wrote:
>
>> Douglas Gregor wrote:
>>>
>>> On Oct 19, 2009, at 8:33 AM, Charles Davis wrote:
>>>> As I said earlier (in an email some of you may not have gotten, I got a
>>>> bunch of warning diagnostics about
>>>> __attribute__((__force_align_arg_pointer__)), which, according to a
>>>> comment in include/windef.h, is supposed to ensure the stack remains
>>>> 16-byte aligned. Is this needed under clang for __stdcall functions on
>>>> Mac OS X? It's apparently needed under gcc.
>>>
>>> We don't have support for this attribute in Clang, and I don't know
>>> whether it is necessary for what you're doing. Please file an extension
>>> request at
>>>
>>> http://llvm.org/bugs/
>> You don't? Well then, I guess, to be on the safe side, I should file a
>> request.
>
> Thanks, I see it at http://llvm.org/bugs/show_bug.cgi?id=5254
>
>>>> Speaking of __stdcall, I got some diagnostics related to
>>>> __attribute__((__stdcall__)) being used on function pointers. gcc does
>>>> not complain about this. Is this a known issue?
>>>
>>> Not one I know about. What diagnostics on what code?
>> Basically, any code that defines a __stdcall function pointer typedef,
>> like this one for example:
>>
>> ../../include/winnt.h:5034:15: warning: '__stdcall__' attribute only
>> applies to
>> function types
>> typedef VOID (NTAPI * PFLS_CALLBACK_FUNCTION) ( PVOID );
>> ^
>> ../../include/winnt.h:44:15: note: instantiated from:
>> #define NTAPI __stdcall
>> ^../../include/windef.h:57:38: note: instantiated from:
>> # define __stdcall __attribute__((__stdcall__))
>> __attribute__((__force_align_
>> arg_pointer__)) ^
>
>
> This boils down to, e.g.,
>
> typedef void (__attribute__((stdcall)) * callback)(int, int);
>
> which we complain about:
>
> stdcall.c:1:30: warning: 'stdcall' attribute only applies to function types
> typedef void (__attribute__((stdcall)) * callback)(int, int);
> ^
>
> Basically, we don't yet have a way to encode the stdcall attribute in
> the type system, so we can't form a function pointer to a stdcall
> function. I've filed a PR for this, here:
>
> http://llvm.org/bugs/show_bug.cgi?id=5310
You did? But I already filed one here:
http://llvm.org/bugs/show_bug.cgi?id=5280
And then someone filed a dupe here:
http://llvm.org/bugs/show_bug.cgi?id=5303
>
> - Doug
Took you a while to get back to me on this. Oh well, I've seen the
commit logs. You guys are busy with C++ support, so this is
understandable. Anyway, thanks.
Chip
More information about the cfe-dev
mailing list