winefile: Explicitly mark qsort() callback funtions cdecl.

Gerald Pfeifer gerald at pfeifer.com
Sat Aug 17 05:43:03 CDT 2019


commit 50af5c83371703016f759abfdc0dc654ae888b84
Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon May 6 03:41:07 2019 -0500

    winefile: Explicitly mark qsort() callback funtions cdecl.
    
    Signed-off-by: Alexandre Julliard <julliard at winehq.org>

includes the following snippet:

  -static int (*sortFunctions[])(const void* arg1, const void* arg2) = {
  +static int (CDECL *sortFunctions[])(const void* arg1, const void* arg2) = {

Now include/windef.h #defines CDECL as __cdecl, and 
include/msvcrt/corecrt.h then #defines __cdecl as
__attribute__((__cdecl__)) __attribute__((__force_align_arg_pointer__)).

However, the __force_align_arg_pointer__ attribute only applies to
functions, not pointers, and clang 7.0.1 (system compiler on FreeBSD)
warns about this:

  winefile.c:937:13: warning: '__force_align_arg_pointer__' attribute only
      applies to functions [-Wignored-attributes]

Is there an easy way around?


(I know we're focusing on GCC, and that's what I usually do, but more
often than not GCC has been adding the same warnings that clang already
had.  Or should we consider this a clang bug?)

Gerald



More information about the wine-devel mailing list