From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel,gmane.comp.lib.gnulib.bugs Subject: Re: New warnings on emacs-26 branch with gcc 8.2.0 Date: Sat, 18 Aug 2018 21:41:26 +0300 Message-ID: <83d0uffrft.fsf@gnu.org> References: <86a7q0ai2z.fsf@gmail.com> <86y3d88x1u.fsf@gmail.com> <9ab72594-da61-a3f4-cac4-6e61cda67da3@cs.ucla.edu> <4195986.6xTypejAr3@omega> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1534617584 3158 195.159.176.226 (18 Aug 2018 18:39:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 18 Aug 2018 18:39:44 +0000 (UTC) Cc: andrewjmoreton@gmail.com, eggert@cs.ucla.edu, bug-gnulib@gnu.org, emacs-devel@gnu.org To: Bruno Haible Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 18 20:39:40 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 1fr68Q-0000fW-EB for ged-emacs-devel@m.gmane.org; Sat, 18 Aug 2018 20:39:38 +0200 Original-Received: from localhost ([::1]:40066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fr6AV-0006Jl-3P for ged-emacs-devel@m.gmane.org; Sat, 18 Aug 2018 14:41:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fr6AL-0006Ja-Ty for emacs-devel@gnu.org; Sat, 18 Aug 2018 14:41:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fr6AI-0002R5-DJ for emacs-devel@gnu.org; Sat, 18 Aug 2018 14:41:37 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fr6AI-0002R1-9b; Sat, 18 Aug 2018 14:41:34 -0400 Original-Received: from [176.228.60.248] (port=3058 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fr6AH-0001fA-Tg; Sat, 18 Aug 2018 14:41:34 -0400 In-reply-to: <4195986.6xTypejAr3@omega> (message from Bruno Haible on Sat, 18 Aug 2018 18:09:27 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:228663 gmane.comp.lib.gnulib.bugs:39211 Archived-At: > From: Bruno Haible > Date: Sat, 18 Aug 2018 18:09:27 +0200 > Cc: Paul Eggert , Andy Moreton , > emacs-devel@gnu.org > > So, there are 4 options: > 1) Use static reference to Windows API functions. > 2) Use '#pragma GCC diagnostic ignored "-Wcast-function-type"' > 3) Remove -Wcast-function-type from the compiler options. > 4) Live with the warning. > > I'm opposed to 1), since it removes either features or portability. > > I could do 2), but it does not feel like the right thing, to silence > a compiler warning when the user has explicitly requested a warning. > > So, please choose among 3) and 4). There's also this additional option: 5) Cast through (void *). Like this: GetSystemTimePreciseAsFileTimeFunc = (GetSystemTimePreciseAsFileTimeFuncType) (void (*) (void)) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime");