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 Subject: Re: [PATCH] Clean up a couple of compiler warnings Date: Fri, 19 May 2017 09:53:46 +0300 Message-ID: <83a86949s5.fsf@gnu.org> References: <20170518202450.75747-1-phst@google.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1495176881 683 195.159.176.226 (19 May 2017 06:54:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 19 May 2017 06:54:41 +0000 (UTC) Cc: phst@google.com, p.stephani2@gmail.com, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 19 08:54:28 2017 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 1dBbnu-0008Cb-KO for ged-emacs-devel@m.gmane.org; Fri, 19 May 2017 08:54:26 +0200 Original-Received: from localhost ([::1]:56874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBbny-00068s-3e for ged-emacs-devel@m.gmane.org; Fri, 19 May 2017 02:54:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBbnS-00068j-7r for emacs-devel@gnu.org; Fri, 19 May 2017 02:53:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBbnR-0006aX-BH for emacs-devel@gnu.org; Fri, 19 May 2017 02:53:58 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBbnM-0006Zj-Li; Fri, 19 May 2017 02:53:52 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3227 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dBbnL-000261-JA; Fri, 19 May 2017 02:53:52 -0400 In-reply-to: (message from Paul Eggert on Thu, 18 May 2017 20:48:42 -0700) 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:214978 Archived-At: > From: Paul Eggert > Date: Thu, 18 May 2017 20:48:42 -0700 > Cc: Philipp Stephani > > > * fileio.c (file_name_case_insensitive_p): Add cast. > > Rather than waste time static-checking the DARWIN_OS_CASE_SENSITIVE_FIXME == 2 > code let's just #ifdef it out. I did that in the 4th attached patch. Maybe we > should just remove it, since nobody is using it and (as you note) it doesn't > work anyway. > [...] > diff --git a/src/fileio.c b/src/fileio.c > index acbf76e..e5e3505 100644 > --- a/src/fileio.c > +++ b/src/fileio.c > @@ -2294,10 +2294,14 @@ file_name_case_insensitive_p (const char *filename) > & VOL_CAP_FMT_CASE_SENSITIVE); > } > } > - else if (DARWIN_OS_CASE_SENSITIVE_FIXME == 2) > +# if DARWIN_OS_CASE_SENSITIVE_FIXME == 2 > { > /* The following is based on > - http://lists.apple.com/archives/darwin-dev/2007/Apr/msg00010.html. */ > + http://lists.apple.com/archives/darwin-dev/2007/Apr/msg00010.html. > + It is normally not even compiled, since it runs afoul of > + static checking. See: > + http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00495.html > + */ > struct attrlist alist; > unsigned char buffer[sizeof (vol_capabilities_attr_t) + sizeof (size_t)]; > > @@ -2309,6 +2313,7 @@ file_name_case_insensitive_p (const char *filename) > vol_capabilities_attr_t *vcaps = buffer; > return !(vcaps->capabilities[0] & VOL_CAP_FMT_CASE_SENSITIVE); > } > +# endif > #endif /* DARWIN_OS */ Should we make the DARWIN_OS_CASE_SENSITIVE_FIXME == 1 case an ifdef as well? It feels strange to try to avoid the ifdef for one value, but not for the other. Thanks for this and the other changes.