From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel,gmane.comp.lib.gnulib.bugs Subject: Re: New warnings on emacs-26 branch with gcc 8.2.0 Date: Mon, 20 Aug 2018 09:20:17 +0100 Message-ID: <86a7pho3em.fsf@gmail.com> References: <86a7q0ai2z.fsf@gmail.com> <4195986.6xTypejAr3@omega> <83d0uffrft.fsf@gnu.org> <2510628.alnMaqBdeU@omega> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1534753129 1378 195.159.176.226 (20 Aug 2018 08:18:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 20 Aug 2018 08:18:49 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (windows-nt) Cc: bug-gnulib@gnu.org To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 20 10:18:45 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frfOf-0000Eq-9Z for ged-emacs-devel@m.gmane.org; Mon, 20 Aug 2018 10:18:45 +0200 Original-Received: from localhost ([::1]:45482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frfQj-0004T1-1w for ged-emacs-devel@m.gmane.org; Mon, 20 Aug 2018 04:20:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frfQV-0004RT-95 for emacs-devel@gnu.org; Mon, 20 Aug 2018 04:20:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frfQP-0001BI-EP for emacs-devel@gnu.org; Mon, 20 Aug 2018 04:20:38 -0400 Original-Received: from [195.159.176.226] (port=46524 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1frfQP-0001Az-8S for emacs-devel@gnu.org; Mon, 20 Aug 2018 04:20:33 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1frfOF-0008E5-F0 for emacs-devel@gnu.org; Mon, 20 Aug 2018 10:18:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:FVOe5DAukakxuKVlCxvwh+A8whw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228713 gmane.comp.lib.gnulib.bugs:39243 Archived-At: 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 in > > . > > 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