https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86407

--- Comment #5 from Alex Henrie <alexhenrie24 at gmail dot com> ---
The fundamental problem here is that some people want to combine calling
convention attributes and certain other attributes in a macro and then use that
macro everywhere, whereas other people want to place each attribute only where
it technically belongs. To make both groups happy, we need more granular
warning options.

One possible solution is to add -Wattribute= and -Wno-attribute= switches for
enabling and disabling warnings about specific attributes. For example, Wine
could set `-Wno-attribute=ms_hook_prologue` to get warnings about all
attributes except the __ms_hook_prologue__ attribute and then include that
attribute in the WINAPI macro. Being able to disable warnings about particular
attributes might also be useful if someone wants to change the calling
convention of all functions that return a particular type. In that case it
might be helpful to have a macro like "#define INT64 long long
__attribute__((__cdecl__))", use it to declare both functions and variables,
and then ignore warnings about __cdecl__ being in more places than it needs to
be.

Another possible solution is to split off warnings about function attributes
being used on function pointers (presumably in addition to the function
definitions) into a new option such as -Wstrict-function-attributes to let
people turn off just that warning specifically.

Either way, __force_align_arg_pointer__ should be changed from a type attribute
to a function attribute, and the syntax for suppressing warnings should be the
same or similar for both __ms_hook_prologue__ and __force_align_arg_pointer__.

Reply via email to