New warnings on emacs-26 branch with gcc 8.2.0

classic Classic list List threaded Threaded
60 messages Options
123
Reply | Threaded
Open this post in threaded view
|

New warnings on emacs-26 branch with gcc 8.2.0

Andy Moreton-3
MSYS2 has recently updated to gcc 8.2.0, and this has introduced a
number of new warnings on the emacs-26 branch.

1) 138 warnings about misuse of "-Wabi":

cc1.exe: warning: -Wabi won't warn about anything [-Wabi]
cc1.exe: note: -Wabi warns about differences from the most up-to-date ABI, which is also used by default
cc1.exe: note: use e.g. -Wabi=11 to warn about changes from GCC 7

The configury is full of a large amount of code to tune warnings, most
of which seems to be turning off things that should not have been turned
on or checked for in the first place. On Windows, bootstrapping takes an
age due to the checking of every last possible gcc warning.

Can this be simplified to be less over-zealous and less time consuming ?


2) 76 warnings from use of "-Wcast-function-type", e.g.

751:C:/emacs/git/emacs/emacs-26/lib/gettimeofday.c:48:2: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'void (*)(FILETIME *)' {aka 'void (*)(struct _FILETIME *)'} [-Wcast-function-type]

Most of these seem to be from GetProcAddress calls, where the desired
function pointer type does not match FARPROC. The gcc docs note:

    The function type void (*) (void) is special and matches
    everything, which can be used to suppress this warning.

As a workaround, this seems worse than the original problem. Can this
warning be disabled, or applied more selectively ?

There is one warning that is not related to GetProcAddress:

C:/emacs/git/emacs/emacs-26/src/emacs-module.c: In function 'Fmodule_load':
C:/emacs/git/emacs/emacs-26/src/emacs-module.c:708:17: warning: cast between incompatible function types from 'dynlib_function_ptr' {aka 'struct dynlib_function_ptr_nonce * (*)(void)'} to 'int (*)(struct emacs_runtime *)' [-Wcast-function-type]
   module_init = (emacs_init_function) dynlib_func (handle, "emacs_module_init");
                 ^
This last one appears to be showing a real problem.

    AndyM


Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Noam Postavsky
On 5 August 2018 at 12:33, Andy Moreton <[hidden email]> wrote:

> The configury is full of a large amount of code to tune warnings, most
> of which seems to be turning off things that should not have been turned
> on or checked for in the first place. On Windows, bootstrapping takes an
> age due to the checking of every last possible gcc warning.

You can reduce this by a lot with the --cache-file (or -C) configure option.

Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Paul Eggert
In reply to this post by Andy Moreton-3
Andy Moreton wrote:

> cc1.exe: warning: -Wabi won't warn about anything [-Wabi]
> cc1.exe: note: -Wabi warns about differences from the most up-to-date ABI, which is also used by default
> cc1.exe: note: use e.g. -Wabi=11 to warn about changes from GCC 7

I noticed this problem a while ago on Fedora in several GNU projects, and fixed
it for Emacs master in commit 2018-06-30T00:31:04![hidden email].

To avoid the problem entirely in the emacs-26 I'd run admin/merge-gnulib and
update everything from Gnulib as it's not worth the trouble to cherry-pick these
sorts of fixes from master. If we'd rather not do admin/merge-gnulib, then we
can just suggest './configure --disable-gcc-warnings' and/or 'make
WERROR_CFLAGS=' to emacs-26 developers; either of these should work around the
problem. (Builders from tarballs needn't worry about this, as GCC warnings are
disabled for them by default.)

> Can this be simplified to be less over-zealous and less time consuming ?
The overzealous-warning part has been fixed on master. I'm sure 'configure'
could be sped up, if someone wants to take the time to work on that.

Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Andy Moreton-3
On Sun 05 Aug 2018, Paul Eggert wrote:

> Andy Moreton wrote:
>
>> cc1.exe: warning: -Wabi won't warn about anything [-Wabi]
>> cc1.exe: note: -Wabi warns about differences from the most up-to-date ABI, which is also used by default
>> cc1.exe: note: use e.g. -Wabi=11 to warn about changes from GCC 7
>
> I noticed this problem a while ago on Fedora in several GNU projects, and
> fixed it for Emacs master in commit 2018-06-30T00:31:04![hidden email].

Thanks. I don't see these -Wabi warning on master.

> To avoid the problem entirely in the emacs-26 I'd run admin/merge-gnulib and
> update everything from Gnulib as it's not worth the trouble to cherry-pick
> these sorts of fixes from master. If we'd rather not do admin/merge-gnulib,
> then we can just suggest './configure --disable-gcc-warnings' and/or 'make
> WERROR_CFLAGS=' to emacs-26 developers; either of these should work around the
> problem. (Builders from tarballs needn't worry about this, as GCC warnings are
> disabled for them by default.)

That's a decision for the maintainers, but I think it would be useful to
fix this if possible.

>> Can this be simplified to be less over-zealous and less time consuming ?
> The overzealous-warning part has been fixed on master. I'm sure 'configure'
> could be sped up, if someone wants to take the time to work on that.

Of the 562 "checking" lines when running configure on master, 146 of
them are "checking whether C compiler handles -W*". This is excessively
time consuming. Can gnulib not do less work to acheive this end, or do
the work more efficiently ?

    AndyM


Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Paul Eggert
Andy Moreton wrote:
> Of the 562 "checking" lines when running configure on master, 146 of
> them are "checking whether C compiler handles -W*". This is excessively
> time consuming. Can gnulib not do less work to acheive this end, or do
> the work more efficiently ?

Yes, it probably could, but it'd take some hacking to get it to work right. So
far, nobody has volunteered to do that. It'd be nontrivial, as the
configure-time code needs to work with older GCCs and with compilers other than GCC.

Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Eli Zaretskii
In reply to this post by Paul Eggert
> From: Paul Eggert <[hidden email]>
> Date: Sun, 5 Aug 2018 12:56:45 -0700
>
> > cc1.exe: warning: -Wabi won't warn about anything [-Wabi]
> > cc1.exe: note: -Wabi warns about differences from the most up-to-date ABI, which is also used by default
> > cc1.exe: note: use e.g. -Wabi=11 to warn about changes from GCC 7
>
> I noticed this problem a while ago on Fedora in several GNU projects, and fixed
> it for Emacs master in commit 2018-06-30T00:31:04![hidden email].
>
> To avoid the problem entirely in the emacs-26 I'd run admin/merge-gnulib and
> update everything from Gnulib as it's not worth the trouble to cherry-pick these
> sorts of fixes from master. If we'd rather not do admin/merge-gnulib, then we
> can just suggest './configure --disable-gcc-warnings' and/or 'make
> WERROR_CFLAGS=' to emacs-26 developers; either of these should work around the
> problem. (Builders from tarballs needn't worry about this, as GCC warnings are
> disabled for them by default.)

Since this warning is disabled when building the tarball, I'd like to
avoid excessive changes on its behalf.  Would it make sense instead to
disable -Wabi on emacs-26?  If not, I'd leave these warnings alone.

Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Paul Eggert
Eli Zaretskii wrote:
> Would it make sense instead to
> disable -Wabi on emacs-26?

I suppose so; I don't know that much about -Wabi.

Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Andy Moreton-3
In reply to this post by Paul Eggert
On Sun 05 Aug 2018, Paul Eggert wrote:

> Andy Moreton wrote:
>> Of the 562 "checking" lines when running configure on master, 146 of
>> them are "checking whether C compiler handles -W*". This is excessively
>> time consuming. Can gnulib not do less work to acheive this end, or do
>> the work more efficiently ?
>
> Yes, it probably could, but it'd take some hacking to get it to work right. So
> far, nobody has volunteered to do that. It'd be nontrivial, as the
> configure-time code needs to work with older GCCs and with compilers other
> than GCC.

Why does it need to check every gcc warning though, rather than just the
-W* and -Wno-* warnings that have been requested in the configury ?

    AndyM


Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Eli Zaretskii
> From: Andy Moreton <[hidden email]>
> Date: Mon, 06 Aug 2018 09:30:27 +0100
>
> Why does it need to check every gcc warning though, rather than just the
> -W* and -Wno-* warnings that have been requested in the configury ?

Because different versions of GCC support different warning options,
and using an option that is not supported by the installed version of
GCC will cause warnings and sometimes errors.

Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Andy Moreton-3
On Mon 06 Aug 2018, Eli Zaretskii wrote:

>> From: Andy Moreton <[hidden email]>
>> Date: Mon, 06 Aug 2018 09:30:27 +0100
>>
>> Why does it need to check every gcc warning though, rather than just the
>> -W* and -Wno-* warnings that have been requested in the configury ?
>
> Because different versions of GCC support different warning options,
> and using an option that is not supported by the installed version of
> GCC will cause warnings and sometimes errors.

That is not what is being discussed. The configure script run 146 checks
to determine if gcc warning options are supported, but the emacs
configure script mentions a far smaller number.

Why are dozens of configure checks being run for things that emacs
configure does not care about, and whose only effect is to slow down
the build ?

    AndyM



Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Eli Zaretskii
> From: Andy Moreton <[hidden email]>
> Date: Mon, 06 Aug 2018 16:26:17 +0100
>
> >> Why does it need to check every gcc warning though, rather than just the
> >> -W* and -Wno-* warnings that have been requested in the configury ?
> >
> > Because different versions of GCC support different warning options,
> > and using an option that is not supported by the installed version of
> > GCC will cause warnings and sometimes errors.
>
> That is not what is being discussed. The configure script run 146 checks
> to determine if gcc warning options are supported, but the emacs
> configure script mentions a far smaller number.

Sorry for my misunderstanding.

Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Paul Eggert
In reply to this post by Andy Moreton-3
Andy Moreton wrote:
> Why does it need to check every gcc warning though, rather than just the
> -W* and -Wno-* warnings that have been requested in the configury ?

Sorry, I don't remember. However, if you'd like to dig through this and suggest
specific improvements, I'm sure we'll be all ears. Nobody likes how long this
stuff takes.

Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Andy Moreton-3
On Mon 06 Aug 2018, Paul Eggert wrote:

> Andy Moreton wrote:
>> Why does it need to check every gcc warning though, rather than just the
>> -W* and -Wno-* warnings that have been requested in the configury ?
>
> Sorry, I don't remember. However, if you'd like to dig through this and
> suggest specific improvements, I'm sure we'll be all ears. Nobody likes how
> long this stuff takes.

I was hoping you could provide more background, as you are are shown as
the most recent committer of almost every line of configure.ac related
to warnings.

Is this problem arising from use of the gnulib manywarnings module ? If
so, why do we use it and not the simpler gnuslib warnings module ?

    AndyM


Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Paul Eggert
Andy Moreton wrote:
> I was hoping you could provide more background, as you are are shown as
> the most recent committer of almost every line of configure.ac related
> to warnings.

Yes, I adapt this stuff for Emacs. However, it sounds like the part you want
changed comes from a part of Gnulib that I do not know as well.

> Is this problem arising from use of the gnulib manywarnings module ? If
> so, why do we use it and not the simpler gnuslib warnings module ?

The warnings module would require the hand-maintained Emacs source code to list
the exact set of warnings that it wants, which would be a pain to maintain as
the set commonly changes after each GCC release. The manywarnings module
maintains such a list for us, which is simpler for Emacs proper (and allows us
to share this mutating list among several GNU projects). The Emacs configure.ac
tailors the Gnulib list a bit, but mostly leaves it alone; this is simpler for
Emacs than maintaining its own sort-of-copy of the list by hand.

Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Eli Zaretskii
In reply to this post by Paul Eggert
> Cc: [hidden email], [hidden email]
> From: Paul Eggert <[hidden email]>
> Date: Sun, 5 Aug 2018 20:16:50 -0700
>
> Eli Zaretskii wrote:
> > Would it make sense instead to
> > disable -Wabi on emacs-26?
>
> I suppose so; I don't know that much about -Wabi.

OK, I've now done so.  Andrew, please see if this fixes the original
problem with this warning.

Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Andy Moreton-3
On Sat 11 Aug 2018, Eli Zaretskii wrote:

>> Cc: [hidden email], [hidden email]
>> From: Paul Eggert <[hidden email]>
>> Date: Sun, 5 Aug 2018 20:16:50 -0700
>>
>> Eli Zaretskii wrote:
>> > Would it make sense instead to
>> > disable -Wabi on emacs-26?
>>
>> I suppose so; I don't know that much about -Wabi.
>
> OK, I've now done so.  Andrew, please see if this fixes the original
> problem with this warning.

Yes, that ha removed that batch of warnings.

There are still other warnings: one from -Wformat-overflow and 78 from
-Wcast-function-type.

    AndyM


Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Eli Zaretskii
> From: Andy Moreton <[hidden email]>
> Date: Sat, 11 Aug 2018 11:41:20 +0100
>
> > OK, I've now done so.  Andrew, please see if this fixes the original
> > problem with this warning.
>
> Yes, that ha removed that batch of warnings.

Thanks for testing.

> There are still other warnings: one from -Wformat-overflow and 78 from
> -Wcast-function-type.

Can you show the warnings from -Wcast-function-type?

Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Andy Moreton-3
On Sat 11 Aug 2018, Eli Zaretskii wrote:

>> From: Andy Moreton <[hidden email]>
>> Date: Sat, 11 Aug 2018 11:41:20 +0100
>>
>> > OK, I've now done so.  Andrew, please see if this fixes the original
>> > problem with this warning.
>>
>> Yes, that ha removed that batch of warnings.
>
> Thanks for testing.
>
>> There are still other warnings: one from -Wformat-overflow and 78 from
>> -Wcast-function-type.
>
> Can you show the warnings from -Wcast-function-type?

Here are the warnings from commit ec6f588940e5, built with gcc 8.2.0.
Mostly this seems to be GetProcAddress results, where it complains that
FARPROC and the desired fuinction type don't match. The gcc manual says
that casting via "void (*)(void)" can be used to pacify the warning.


  CC       dynlib.o
C:/emacs/git/emacs/emacs-26/src/dynlib.c: In function 'dynlib_addr':
C:/emacs/git/emacs/emacs-26/src/dynlib.c:160:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(DWORD,  const CHAR *, struct HINSTANCE__ **)' {aka 'int (*)(long unsigned int,  const char *, struct HINSTANCE__ **)'} [-Wcast-function-type]
      (GetModuleHandleExA_Proc) GetProcAddress (hm_kernel32,
      ^
  CC       emacs-module.o
C:/emacs/git/emacs/emacs-26/src/emacs-module.c: In function 'Fmodule_load':
C:/emacs/git/emacs/emacs-26/src/emacs-module.c:708:17: warning: cast between incompatible function types from 'dynlib_function_ptr' {aka 'struct dynlib_function_ptr_nonce * (*)(void)'} to 'int (*)(struct emacs_runtime *)' [-Wcast-function-type]
   module_init = (emacs_init_function) dynlib_func (handle, "emacs_module_init");
                 ^
  CC       w32fns.o
C:/emacs/git/emacs/emacs-26/src/w32fns.c: In function 'setup_w32_kbdhook':
C:/emacs/git/emacs/emacs-26/src/w32fns.c:2642:52: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void)' {aka 'int (*)(void)'} [-Wcast-function-type]
       IsDebuggerPresent_Proc is_debugger_present = (IsDebuggerPresent_Proc)
                                                    ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c:2657:43: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'struct HWND__ * (*)(void)' [-Wcast-function-type]
       GetConsoleWindow_Proc get_console = (GetConsoleWindow_Proc)
                                           ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c: In function 'Ffile_system_info':
C:/emacs/git/emacs/emacs-26/src/w32fns.c:9376:7: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(const WCHAR *, ULARGE_INTEGER *, ULARGE_INTEGER *, ULARGE_INTEGER *)' {aka 'int (*)(const short unsigned int *, union _ULARGE_INTEGER *, union _ULARGE_INTEGER *, union _ULARGE_INTEGER *)'} [-Wcast-function-type]
       (GetDiskFreeSpaceExW_Proc) GetProcAddress (hKernel, "GetDiskFreeSpaceExW");
       ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c:9378:7: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(const CHAR *, ULARGE_INTEGER *, ULARGE_INTEGER *, ULARGE_INTEGER *)' {aka 'int (*)(const char *, union _ULARGE_INTEGER *, union _ULARGE_INTEGER *, union _ULARGE_INTEGER *)'} [-Wcast-function-type]
       (GetDiskFreeSpaceExA_Proc) GetProcAddress (hKernel, "GetDiskFreeSpaceExA");
       ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c: In function 'get_dll_version':
C:/emacs/git/emacs/emacs-26/src/w32fns.c:9954:4: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'HRESULT (*)(DLLVERSIONINFO *)' {aka 'long int (*)(struct _DLLVERSIONINFO *)'} [-Wcast-function-type]
  = (DLLGETVERSIONPROC) GetProcAddress (hdll, "DllGetVersion");
    ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c: In function 'w32_reset_stack_overflow_guard':
C:/emacs/git/emacs/emacs-26/src/w32fns.c:10856:7: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'int (*)(void)' [-Wcast-function-type]
       (_resetstkoflw_proc)GetProcAddress (GetModuleHandle ("msvcrt.dll"),
       ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c: In function 'w32_backtrace':
C:/emacs/git/emacs/emacs-26/src/w32fns.c:10932:2: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'USHORT (*)(ULONG,  ULONG,  void **, ULONG *)' {aka 'short unsigned int (*)(long unsigned int,  long unsigned int,  void **, long unsigned int *)'} [-Wcast-function-type]
  (CaptureStackBackTrace_proc) GetProcAddress (hm_kernel32,
  ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c: In function 'globals_of_w32fns':
C:/emacs/git/emacs/emacs-26/src/w32fns.c:11065:26: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct tagTRACKMOUSEEVENT *)' {aka 'int (*)(struct tagTRACKMOUSEEVENT *)'} [-Wcast-function-type]
   track_mouse_event_fn = (TrackMouseEvent_Proc)
                          ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c:11068:27: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'struct HMONITOR__ * (*)(POINT,  DWORD)' {aka 'struct HMONITOR__ * (*)(struct tagPOINT,  long unsigned int)'} [-Wcast-function-type]
   monitor_from_point_fn = (MonitorFromPoint_Proc)
                           ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c:11070:25: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct HMONITOR__ *, struct MONITOR_INFO *)' {aka 'int (*)(struct HMONITOR__ *, struct MONITOR_INFO *)'} [-Wcast-function-type]
   get_monitor_info_fn = (GetMonitorInfo_Proc)
                         ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c:11072:28: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'struct HMONITOR__ * (*)(struct HWND__ *, DWORD)' {aka 'struct HMONITOR__ * (*)(struct HWND__ *, long unsigned int)'} [-Wcast-function-type]
   monitor_from_window_fn = (MonitorFromWindow_Proc)
                            ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c:11074:30: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct HDC__ *, RECT *, BOOL (*)(struct HMONITOR__ *, struct HDC__ *, RECT *, LPARAM), LPARAM)' {aka 'int (*)(struct HDC__ *, struct tagRECT *, int (*)(struct HMONITOR__ *, struct HDC__ *, struct tagRECT *, long long int), long long int)'} [-Wcast-function-type]
   enum_display_monitors_fn = (EnumDisplayMonitors_Proc)
                              ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c:11076:27: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct HWND__ *, TITLEBAR_INFO *)' {aka 'int (*)(struct HWND__ *, struct <anonymous> *)'} [-Wcast-function-type]
   get_title_bar_info_fn = (GetTitleBarInfo_Proc)
                           ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c:11081:33: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'LONG (*)(struct HIMC__ *, DWORD,  void *, DWORD)' {aka 'long int (*)(struct HIMC__ *, long unsigned int,  void *, long unsigned int)'} [-Wcast-function-type]
     get_composition_string_fn = (ImmGetCompositionString_Proc)
                                 ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c:11083:26: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'struct HIMC__ * (*)(struct HWND__ *)' [-Wcast-function-type]
     get_ime_context_fn = (ImmGetContext_Proc)
                          ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c:11085:30: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct HWND__ *, struct HIMC__ *)' {aka 'int (*)(struct HWND__ *, struct HIMC__ *)'} [-Wcast-function-type]
     release_ime_context_fn = (ImmReleaseContext_Proc)
                              ^
C:/emacs/git/emacs/emacs-26/src/w32fns.c:11087:37: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct HIMC__ *, COMPOSITIONFORM *)' {aka 'int (*)(struct HIMC__ *, struct tagCOMPOSITIONFORM *)'} [-Wcast-function-type]
     set_ime_composition_window_fn = (ImmSetCompositionWindow_Proc)
                                     ^
  CC       w32menu.o
C:/emacs/git/emacs/emacs-26/src/w32menu.c: In function 'globals_of_w32menu':
C:/emacs/git/emacs/emacs-26/src/w32menu.c:1609:24: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct HMENU__ *, UINT,  BOOL,  struct tagMENUITEMINFOA *)' {aka 'int (*)(struct HMENU__ *, unsigned int,  int,  struct tagMENUITEMINFOA *)'} [-Wcast-function-type]
   get_menu_item_info = (GetMenuItemInfoA_Proc) GetProcAddress (user32, "GetMenuItemInfoA");
                        ^
C:/emacs/git/emacs/emacs-26/src/w32menu.c:1610:24: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct HMENU__ *, UINT,  BOOL,  const MENUITEMINFOA *)' {aka 'int (*)(struct HMENU__ *, unsigned int,  int,  const struct tagMENUITEMINFOA *)'} [-Wcast-function-type]
   set_menu_item_info = (SetMenuItemInfoA_Proc) GetProcAddress (user32, "SetMenuItemInfoA");
                        ^
C:/emacs/git/emacs/emacs-26/src/w32menu.c:1611:25: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct HMENU__ *, UINT,  UINT_PTR,  const WCHAR *)' {aka 'int (*)(struct HMENU__ *, unsigned int,  long long unsigned int,  const short unsigned int *)'} [-Wcast-function-type]
   unicode_append_menu = (AppendMenuW_Proc) GetProcAddress (user32, "AppendMenuW");
                         ^
C:/emacs/git/emacs/emacs-26/src/w32menu.c:1612:25: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'int (*)(struct HWND__ *, const WCHAR *, const WCHAR *, UINT)' {aka 'int (*)(struct HWND__ *, const short unsigned int *, const short unsigned int *, unsigned int)'} [-Wcast-function-type]
   unicode_message_box = (MessageBoxW_Proc) GetProcAddress (user32, "MessageBoxW");
                         ^
  CC       w32font.o
C:/emacs/git/emacs/emacs-26/src/w32font.c: In function 'get_outline_metrics_w':
C:/emacs/git/emacs/emacs-26/src/w32font.c:155:36: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'UINT (*)(struct HDC__ *, UINT,  struct _OUTLINETEXTMETRICW *)' {aka 'unsigned int (*)(struct HDC__ *, unsigned int,  struct _OUTLINETEXTMETRICW *)'} [-Wcast-function-type]
  s_pfn_Get_Outline_Text_MetricsW = (GetOutlineTextMetricsW_Proc)
                                    ^
C:/emacs/git/emacs/emacs-26/src/w32font.c: In function 'get_text_metrics_w':
C:/emacs/git/emacs/emacs-26/src/w32font.c:172:28: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct HDC__ *, struct tagTEXTMETRICW *)' {aka 'int (*)(struct HDC__ *, struct tagTEXTMETRICW *)'} [-Wcast-function-type]
  s_pfn_Get_Text_MetricsW = (GetTextMetricsW_Proc)
                            ^
C:/emacs/git/emacs/emacs-26/src/w32font.c: In function 'get_glyph_outline_w':
C:/emacs/git/emacs/emacs-26/src/w32font.c:190:29: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'DWORD (*)(struct HDC__ *, UINT,  UINT,  struct _GLYPHMETRICS *, DWORD,  void *, const MAT2 *)' {aka 'long unsigned int (*)(struct HDC__ *, unsigned int,  unsigned int,  struct _GLYPHMETRICS *, long unsigned int,  void *, const struct _MAT2 *)'} [-Wcast-function-type]
  s_pfn_Get_Glyph_OutlineW = (GetGlyphOutlineW_Proc)
                             ^
C:/emacs/git/emacs/emacs-26/src/w32font.c: In function 'get_char_width_32_w':
C:/emacs/git/emacs/emacs-26/src/w32font.c:208:29: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct HDC__ *, UINT,  UINT,  int *)' {aka 'int (*)(struct HDC__ *, unsigned int,  unsigned int,  int *)'} [-Wcast-function-type]
  s_pfn_Get_Char_Width_32W = (GetCharWidth32W_Proc)
                             ^
  CC       w32uniscribe.o
C:/emacs/git/emacs/emacs-26/src/w32uniscribe.c: In function 'syms_of_w32uniscribe':
C:/emacs/git/emacs/emacs-26/src/w32uniscribe.c:1196:32: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'HRESULT (*)(struct HDC__ *, void **, SCRIPT_ANALYSIS *, int,  OPENTYPE_TAG *, int *)' {aka 'long int (*)(struct HDC__ *, void **, struct tag_SCRIPT_ANALYSIS *, int,  long unsigned int *, int *)'} [-Wcast-function-type]
   script_get_font_scripts_fn = (ScriptGetFontScriptTags_Proc)
                                ^
C:/emacs/git/emacs/emacs-26/src/w32uniscribe.c:1198:34: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'HRESULT (*)(struct HDC__ *, void **, SCRIPT_ANALYSIS *, OPENTYPE_TAG,  int,  OPENTYPE_TAG *, int *)' {aka 'long int (*)(struct HDC__ *, void **, struct tag_SCRIPT_ANALYSIS *, long unsigned int,  int,  long unsigned int *, int *)'} [-Wcast-function-type]
   script_get_font_languages_fn = (ScriptGetFontLanguageTags_Proc)
                                  ^
C:/emacs/git/emacs/emacs-26/src/w32uniscribe.c:1200:33: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'HRESULT (*)(struct HDC__ *, void **, SCRIPT_ANALYSIS *, OPENTYPE_TAG,  OPENTYPE_TAG,  int,  OPENTYPE_TAG *, int *)' {aka 'long int (*)(struct HDC__ *, void **, struct tag_SCRIPT_ANALYSIS *, long unsigned int,  long unsigned int,  int,  long unsigned int *, int *)'} [-Wcast-function-type]
   script_get_font_features_fn = (ScriptGetFontFeatureTags_Proc)
                                 ^
  CC       w32.o
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'open_process_token':
C:/emacs/git/emacs/emacs-26/src/w32.c:574:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, DWORD,  void **)' {aka 'int (*)(void *, long unsigned int,  void **)'} [-Wcast-function-type]
         (OpenProcessToken_Proc) GetProcAddress (hm_advapi32, "OpenProcessToken");
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_token_information':
C:/emacs/git/emacs/emacs-26/src/w32.c:606:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, TOKEN_INFORMATION_CLASS,  void *, DWORD,  DWORD *)' {aka 'int (*)(void *, enum _TOKEN_INFORMATION_CLASS,  void *, long unsigned int,  long unsigned int *)'} [-Wcast-function-type]
         (GetTokenInformation_Proc) GetProcAddress (hm_advapi32, "GetTokenInformation");
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'lookup_account_sid':
C:/emacs/git/emacs/emacs-26/src/w32.c:642:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(const CHAR *, void *, CHAR *, DWORD *, CHAR *, DWORD *, enum _SID_NAME_USE *)' {aka 'int (*)(const char *, void *, char *, long unsigned int *, char *, long unsigned int *, enum _SID_NAME_USE *)'} [-Wcast-function-type]
         (LookupAccountSid_Proc) GetProcAddress (hm_advapi32, LookupAccountSid_Name);
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_sid_sub_authority':
C:/emacs/git/emacs/emacs-26/src/w32.c:675:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'DWORD * (*)(void *, DWORD)' {aka 'long unsigned int * (*)(void *, long unsigned int)'} [-Wcast-function-type]
         (GetSidSubAuthority_Proc) GetProcAddress (
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_sid_sub_authority_count':
C:/emacs/git/emacs/emacs-26/src/w32.c:700:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'UCHAR * (*)(void *)' {aka 'unsigned char * (*)(void *)'} [-Wcast-function-type]
         (GetSidSubAuthorityCount_Proc) GetProcAddress (
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_security_info':
C:/emacs/git/emacs/emacs-26/src/w32.c:731:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'DWORD (*)(void *, SE_OBJECT_TYPE,  SECURITY_INFORMATION,  void **, void **, ACL **, ACL **, void **)' {aka 'long unsigned int (*)(void *, enum _SE_OBJECT_TYPE,  long unsigned int,  void **, void **, struct _ACL **, struct _ACL **, void **)'} [-Wcast-function-type]
         (GetSecurityInfo_Proc) GetProcAddress (
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_file_security':
C:/emacs/git/emacs/emacs-26/src/w32.c:767:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(const WCHAR *, SECURITY_INFORMATION,  void *, DWORD,  DWORD *)' {aka 'int (*)(const short unsigned int *, long unsigned int,  void *, long unsigned int,  long unsigned int *)'} [-Wcast-function-type]
      (GetFileSecurityW_Proc) GetProcAddress (hm_advapi32,
      ^
C:/emacs/git/emacs/emacs-26/src/w32.c:789:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(const CHAR *, SECURITY_INFORMATION,  void *, DWORD,  DWORD *)' {aka 'int (*)(const char *, long unsigned int,  void *, long unsigned int,  long unsigned int *)'} [-Wcast-function-type]
      (GetFileSecurityA_Proc) GetProcAddress (hm_advapi32,
      ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'set_file_security':
C:/emacs/git/emacs/emacs-26/src/w32.c:826:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(const WCHAR *, SECURITY_INFORMATION,  void *)' {aka 'int (*)(const short unsigned int *, long unsigned int,  void *)'} [-Wcast-function-type]
      (SetFileSecurityW_Proc) GetProcAddress (hm_advapi32,
      ^
C:/emacs/git/emacs/emacs-26/src/w32.c:847:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(const CHAR *, SECURITY_INFORMATION,  void *)' {aka 'int (*)(const char *, long unsigned int,  void *)'} [-Wcast-function-type]
      (SetFileSecurityA_Proc) GetProcAddress (hm_advapi32,
      ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'set_named_security_info':
C:/emacs/git/emacs/emacs-26/src/w32.c:887:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'DWORD (*)(const WCHAR *, SE_OBJECT_TYPE,  SECURITY_INFORMATION,  void *, void *, ACL *, ACL *)' {aka 'long unsigned int (*)(const short unsigned int *, enum _SE_OBJECT_TYPE,  long unsigned int,  void *, void *, struct _ACL *, struct _ACL *)'} [-Wcast-function-type]
      (SetNamedSecurityInfoW_Proc) GetProcAddress (hm_advapi32,
      ^
C:/emacs/git/emacs/emacs-26/src/w32.c:909:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'DWORD (*)(const CHAR *, SE_OBJECT_TYPE,  SECURITY_INFORMATION,  void *, void *, ACL *, ACL *)' {aka 'long unsigned int (*)(const char *, enum _SE_OBJECT_TYPE,  long unsigned int,  void *, void *, struct _ACL *, struct _ACL *)'} [-Wcast-function-type]
      (SetNamedSecurityInfoA_Proc) GetProcAddress (hm_advapi32,
      ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_security_descriptor_owner':
C:/emacs/git/emacs/emacs-26/src/w32.c:941:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, void **, WINBOOL *)' {aka 'int (*)(void *, void **, int *)'} [-Wcast-function-type]
         (GetSecurityDescriptorOwner_Proc) GetProcAddress (
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_security_descriptor_group':
C:/emacs/git/emacs/emacs-26/src/w32.c:970:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, void **, WINBOOL *)' {aka 'int (*)(void *, void **, int *)'} [-Wcast-function-type]
         (GetSecurityDescriptorGroup_Proc) GetProcAddress (
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_security_descriptor_dacl':
C:/emacs/git/emacs/emacs-26/src/w32.c:1000:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, WINBOOL *, ACL **, WINBOOL *)' {aka 'int (*)(void *, int *, struct _ACL **, int *)'} [-Wcast-function-type]
         (GetSecurityDescriptorDacl_Proc) GetProcAddress (
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'is_valid_sid':
C:/emacs/git/emacs/emacs-26/src/w32.c:1027:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *)' {aka 'int (*)(void *)'} [-Wcast-function-type]
         (IsValidSid_Proc) GetProcAddress (
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'equal_sid':
C:/emacs/git/emacs/emacs-26/src/w32.c:1051:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, void *)' {aka 'int (*)(void *, void *)'} [-Wcast-function-type]
         (EqualSid_Proc) GetProcAddress (
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_length_sid':
C:/emacs/git/emacs/emacs-26/src/w32.c:1075:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'DWORD (*)(void *)' {aka 'long unsigned int (*)(void *)'} [-Wcast-function-type]
         (GetLengthSid_Proc) GetProcAddress (
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'copy_sid':
C:/emacs/git/emacs/emacs-26/src/w32.c:1099:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(DWORD,  void *, void *)' {aka 'int (*)(long unsigned int,  void *, void *)'} [-Wcast-function-type]
         (CopySid_Proc) GetProcAddress (
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_native_system_info':
C:/emacs/git/emacs/emacs-26/src/w32.c:1125:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'void (*)(struct _SYSTEM_INFO *)' [-Wcast-function-type]
      (GetNativeSystemInfo_Proc)GetProcAddress (GetModuleHandle ("kernel32.dll"),
      ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_system_times':
C:/emacs/git/emacs/emacs-26/src/w32.c:1149:2: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct _FILETIME *, struct _FILETIME *, struct _FILETIME *)' {aka 'int (*)(struct _FILETIME *, struct _FILETIME *, struct _FILETIME *)'} [-Wcast-function-type]
  (GetSystemTimes_Proc)GetProcAddress (GetModuleHandle ("kernel32.dll"),
  ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'create_symbolic_link':
C:/emacs/git/emacs/emacs-26/src/w32.c:1179:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOLEAN (*)(const WCHAR *, const WCHAR *, DWORD)' {aka 'unsigned char (*)(const short unsigned int *, const short unsigned int *, long unsigned int)'} [-Wcast-function-type]
      (CreateSymbolicLinkW_Proc)GetProcAddress (GetModuleHandle ("kernel32.dll"),
      ^
C:/emacs/git/emacs/emacs-26/src/w32.c:1214:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOLEAN (*)(const CHAR *, const CHAR *, DWORD)' {aka 'unsigned char (*)(const char *, const char *, long unsigned int)'} [-Wcast-function-type]
      (CreateSymbolicLinkA_Proc)GetProcAddress (GetModuleHandle ("kernel32.dll"),
      ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'is_valid_security_descriptor':
C:/emacs/git/emacs/emacs-26/src/w32.c:1259:2: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *)' {aka 'int (*)(void *)'} [-Wcast-function-type]
  (IsValidSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
  ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'convert_sd_to_sddl':
C:/emacs/git/emacs/emacs-26/src/w32.c:1296:2: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, DWORD,  SECURITY_INFORMATION,  CHAR **, ULONG *)' {aka 'int (*)(void *, long unsigned int,  long unsigned int,  char **, long unsigned int *)'} [-Wcast-function-type]
  (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
  ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'convert_sddl_to_sd':
C:/emacs/git/emacs/emacs-26/src/w32.c:1339:2: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(const CHAR *, DWORD,  void **, ULONG *)' {aka 'int (*)(const char *, long unsigned int,  void **, long unsigned int *)'} [-Wcast-function-type]
  (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)GetProcAddress (GetModuleHandle ("Advapi32.dll"),
  ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_adapters_info':
C:/emacs/git/emacs/emacs-26/src/w32.c:1371:28: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'DWORD (*)(struct _IP_ADAPTER_INFO *, ULONG *)' {aka 'long unsigned int (*)(struct _IP_ADAPTER_INFO *, long unsigned int *)'} [-Wcast-function-type]
  s_pfn_Get_Adapters_Info = (GetAdaptersInfo_Proc)
                            ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'init_environment':
C:/emacs/git/emacs/emacs-26/src/w32.c:2730:20: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'HRESULT (*)(struct HWND__ *, int,  void *, DWORD,  char *)' {aka 'long int (*)(struct HWND__ *, int,  void *, long unsigned int,  char *)'} [-Wcast-function-type]
  get_folder_path = (ShGetFolderPath_fn)
                    ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'create_toolhelp32_snapshot':
C:/emacs/git/emacs/emacs-26/src/w32.c:6562:42: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'void * (*)(DWORD,  DWORD)' {aka 'void * (*)(long unsigned int,  long unsigned int)'} [-Wcast-function-type]
       s_pfn_Create_Toolhelp32_Snapshot = (CreateToolhelp32Snapshot_Proc)
                                          ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'process32_first':
C:/emacs/git/emacs/emacs-26/src/w32.c:6581:31: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, PROCESSENTRY32 *)' {aka 'int (*)(void *, struct tagPROCESSENTRY32 *)'} [-Wcast-function-type]
       s_pfn_Process32_First = (Process32First_Proc)
                               ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'process32_next':
C:/emacs/git/emacs/emacs-26/src/w32.c:6600:30: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, PROCESSENTRY32 *)' {aka 'int (*)(void *, struct tagPROCESSENTRY32 *)'} [-Wcast-function-type]
       s_pfn_Process32_Next = (Process32Next_Proc)
                              ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'open_thread_token':
C:/emacs/git/emacs/emacs-26/src/w32.c:6629:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, DWORD,  BOOL,  void **)' {aka 'int (*)(void *, long unsigned int,  int,  void **)'} [-Wcast-function-type]
         (OpenThreadToken_Proc) GetProcAddress (hm_advapi32, "OpenThreadToken");
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'impersonate_self':
C:/emacs/git/emacs/emacs-26/src/w32.c:6659:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(SECURITY_IMPERSONATION_LEVEL)' {aka 'int (*)(enum _SECURITY_IMPERSONATION_LEVEL)'} [-Wcast-function-type]
         (ImpersonateSelf_Proc) GetProcAddress (hm_advapi32, "ImpersonateSelf");
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'revert_to_self':
C:/emacs/git/emacs/emacs-26/src/w32.c:6682:9: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void)' {aka 'int (*)(void)'} [-Wcast-function-type]
         (RevertToSelf_Proc) GetProcAddress (hm_advapi32, "RevertToSelf");
         ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_process_memory_info':
C:/emacs/git/emacs/emacs-26/src/w32.c:6707:34: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, PROCESS_MEMORY_COUNTERS *, DWORD)' {aka 'int (*)(void *, struct _PROCESS_MEMORY_COUNTERS *, long unsigned int)'} [-Wcast-function-type]
  s_pfn_Get_Process_Memory_Info = (GetProcessMemoryInfo_Proc)
                                  ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'get_process_working_set_size':
C:/emacs/git/emacs/emacs-26/src/w32.c:6732:44: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, ULONG_PTR *, ULONG_PTR *)' {aka 'int (*)(void *, long long unsigned int *, long long unsigned int *)'} [-Wcast-function-type]
       s_pfn_Get_Process_Working_Set_Size = (GetProcessWorkingSetSize_Proc)
                                            ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'global_memory_status':
C:/emacs/git/emacs/emacs-26/src/w32.c:6755:36: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct _MEMORYSTATUS *)' {aka 'int (*)(struct _MEMORYSTATUS *)'} [-Wcast-function-type]
       s_pfn_Global_Memory_Status = (GlobalMemoryStatus_Proc)
                                    ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'global_memory_status_ex':
C:/emacs/git/emacs/emacs-26/src/w32.c:6778:39: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(struct _MEMORY_STATUS_EX *)' {aka 'int (*)(struct _MEMORY_STATUS_EX *)'} [-Wcast-function-type]
       s_pfn_Global_Memory_Status_Ex = (GlobalMemoryStatusEx_Proc)
                                       ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'maybe_load_unicows_dll':
C:/emacs/git/emacs/emacs-26/src/w32.c:9607:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'int (*)(UINT,  DWORD,  const CHAR *, int,  WCHAR *, int)' {aka 'int (*)(unsigned int,  long unsigned int,  const char *, int,  short unsigned int *, int)'} [-Wcast-function-type]
      (MultiByteToWideChar_Proc)GetProcAddress (ret, "MultiByteToWideChar");
      ^
C:/emacs/git/emacs/emacs-26/src/w32.c:9609:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'int (*)(UINT,  DWORD,  const WCHAR *, int,  CHAR *, int,  const CHAR *, WINBOOL *)' {aka 'int (*)(unsigned int,  long unsigned int,  const short unsigned int *, int,  char *, int,  const char *, int *)'} [-Wcast-function-type]
      (WideCharToMultiByte_Proc)GetProcAddress (ret, "WideCharToMultiByte");
      ^
C:/emacs/git/emacs/emacs-26/src/w32.c: In function 'globals_of_w32':
C:/emacs/git/emacs/emacs-26/src/w32.c:9659:26: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, struct _FILETIME *, struct _FILETIME *, struct _FILETIME *, struct _FILETIME *)' {aka 'int (*)(void *, struct _FILETIME *, struct _FILETIME *, struct _FILETIME *, struct _FILETIME *)'} [-Wcast-function-type]
   get_process_times_fn = (GetProcessTimes_Proc)
                          ^
  CC       w32heap.o
C:/emacs/git/emacs/emacs-26/src/w32heap.c: In function 'init_heap':
C:/emacs/git/emacs/emacs-26/src/w32heap.c:284:4: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'void * (*)(ULONG,  void *, SIZE_T,  SIZE_T,  void *, void *)' {aka 'void * (*)(long unsigned int,  void *, long long unsigned int,  long long unsigned int,  void *, void *)'} [-Wcast-function-type]
  = (RtlCreateHeap_Proc) GetProcAddress (hm_ntdll, "RtlCreateHeap");
    ^
  CC       w32proc.o
C:/emacs/git/emacs/emacs-26/src/w32proc.c: In function 'init_timers':
C:/emacs/git/emacs/emacs-26/src/w32proc.c:552:7: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *, struct _FILETIME *, struct _FILETIME *, struct _FILETIME *, struct _FILETIME *)' {aka 'int (*)(void *, struct _FILETIME *, struct _FILETIME *, struct _FILETIME *, struct _FILETIME *)'} [-Wcast-function-type]
       (GetThreadTimes_Proc)GetProcAddress (GetModuleHandle ("kernel32.dll"),
       ^
C:/emacs/git/emacs/emacs-26/src/w32proc.c: In function 'sys_kill':
C:/emacs/git/emacs/emacs-26/src/w32proc.c:2693:32: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(void *)' {aka 'int (*)(void *)'} [-Wcast-function-type]
    s_pfn_Debug_Break_Process = (DebugBreakProcess_Proc)
                                ^
C:/emacs/git/emacs/emacs-26/src/w32proc.c: In function 'w32_compare_strings':
C:/emacs/git/emacs/emacs-26/src/w32proc.c:3612:13: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'int (*)(LCID,  DWORD,  const WCHAR *, int,  const WCHAR *, int)' {aka 'int (*)(long unsigned int,  long unsigned int,  const short unsigned int *, int,  const short unsigned int *, int)'} [-Wcast-function-type]
             (CompareStringW_Proc) GetProcAddress (LoadLibrary ("Unicows.dll"),
             ^


Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Andy Moreton-3
In reply to this post by Paul Eggert
On Mon 06 Aug 2018, Paul Eggert wrote:

> Andy Moreton wrote:
>> I was hoping you could provide more background, as you are are shown as
>> the most recent committer of almost every line of configure.ac related
>> to warnings.
>
> Yes, I adapt this stuff for Emacs. However, it sounds like the part you want
> changed comes from a part of Gnulib that I do not know as well.
>
>> Is this problem arising from use of the gnulib manywarnings module ? If
>> so, why do we use it and not the simpler gnuslib warnings module ?
>
> The warnings module would require the hand-maintained Emacs source code to
> list the exact set of warnings that it wants, which would be a pain to
> maintain as the set commonly changes after each GCC release. The manywarnings
> module maintains such a list for us, which is simpler for Emacs proper (and
> allows us to share this mutating list among several GNU projects). The Emacs
> configure.ac tailors the Gnulib list a bit, but mostly leaves it alone; this
> is simpler for Emacs than maintaining its own sort-of-copy of the list by
> hand.

Using the manywarnings module still requires emacs to add new warnings to
the nw list every time gcc is upgraded, so I don't think that is less
work.

The manywarnings list also lists every conceivable warning, including
-Wall and -Wextra (why specify so many explicitly then?) and some that
are specific to C++ (why list them at all?).

It woudl surely be simpler to use _Wall -Wextra and a limited number of
additional warnings that know to be useful, rather than checking if every
warning is supported, even if they are unused and pointless.

    AndyM


Reply | Threaded
Open this post in threaded view
|

Re: New warnings on emacs-26 branch with gcc 8.2.0

Eli Zaretskii
In reply to this post by Andy Moreton-3
> From: Andy Moreton <[hidden email]>
> Date: Sat, 11 Aug 2018 16:02:03 +0100
>
> On Sat 11 Aug 2018, Eli Zaretskii wrote:
>
> >> From: Andy Moreton <[hidden email]>
> >> Date: Sat, 11 Aug 2018 11:41:20 +0100
> >>
> >> > OK, I've now done so.  Andrew, please see if this fixes the original
> >> > problem with this warning.
> >>
> >> Yes, that ha removed that batch of warnings.
> >
> > Thanks for testing.
> >
> >> There are still other warnings: one from -Wformat-overflow and 78 from
> >> -Wcast-function-type.
> >
> > Can you show the warnings from -Wcast-function-type?
>
> Here are the warnings from commit ec6f588940e5, built with gcc 8.2.0.
> Mostly this seems to be GetProcAddress results, where it complains that
> FARPROC and the desired fuinction type don't match. The gcc manual says
> that casting via "void (*)(void)" can be used to pacify the warning.
>
>
>   CC       dynlib.o
> C:/emacs/git/emacs/emacs-26/src/dynlib.c: In function 'dynlib_addr':
> C:/emacs/git/emacs/emacs-26/src/dynlib.c:160:6: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'BOOL (*)(DWORD,  const CHAR *, struct HINSTANCE__ **)' {aka 'int (*)(long unsigned int,  const char *, struct HINSTANCE__ **)'} [-Wcast-function-type]
>       (GetModuleHandleExA_Proc) GetProcAddress (hm_kernel32,
>       ^

Does it help to take the GetProcAddress call in parentheses, like
this:

          s_pfn_Get_Module_HandleExA =
            (GetModuleHandleExA_Proc) (GetProcAddress (hm_kernel32,
                                                       "GetModuleHandleExA"));

?

If this doesn't help, what about removing the cast entirely?

In any case, I think it's a GCC bug: it thinks we are type-casting the
function being called, which is GetProcAddress, whereas what we really
want to do is cast the _value_ the function returns.

Thanks.

123