emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Clean up a couple of compiler warnings


From: Eli Zaretskii
Subject: Re: [PATCH] Clean up a couple of compiler warnings
Date: Fri, 19 May 2017 09:53:46 +0300

> From: Paul Eggert <address@hidden>
> Date: Thu, 18 May 2017 20:48:42 -0700
> Cc: Philipp Stephani <address@hidden>
> 
>  > * 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.



reply via email to

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