emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Andy Moreton
Subject: Re: New warnings on emacs-26 branch with gcc 8.2.0
Date: Mon, 20 Aug 2018 09:20:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (windows-nt)

On Sun 19 Aug 2018, Richard Stallman wrote:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
>         > Avoid -Wcast-function-type warnings from casts after GetProcAddress.
>         > Reported by Andy Moreton <address@hidden> in
>         > 
> <https://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00468.html>.
>         > Solution proposed by Eli Zaretskii.
>
> Why make our code more complicated to cater to a program?

GetProcAddress is used for runtime linking on Windows (similar to dlsym
on POSIX platforms). It returns a FARPROC function pointer type, which
has a different function signature to almost any function that you care
to lookup for runtime linking.

GCC 8.1 and later have a new -Wcast-function-type warning (which is
useful, and which emacs enables). This warning requires either an
additional cast or a pragma to suppress the warning at these call sites,
as the mismatch of function signature cannot be fixed otherwise.

Doing so allow emacs to continue to use the warning, and thus warn about
misuse of function pointers at other places in emacs.

    AndyM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]