[PATCH] cygwin: fix errors with GCC 5

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Feb 12 09:31:00 GMT 2016


Hi Yaakov,

On Feb 11 20:26, Yaakov Selkowitz wrote:
> GCC 5 switched from C89 to C11 by default, which implies a change from
> GNU to C99 inline.
> 
> 	winsup/cygwin/
> 	* exceptions.cc (exception::handle): Fix always-true boolean
> 	comparison warning.
> 	* include/cygwin/config.h (__getreent): Mark gnu_inline.
> 	* winbase.h (ilockcmpexch, ilockcmpexch64): Ditto.
> 
> Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
> ---
>  winsup/cygwin/exceptions.cc           | 2 +-
>  winsup/cygwin/include/cygwin/config.h | 1 +
>  winsup/cygwin/winbase.h               | 2 ++
>  3 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
> index c3a45d2..a50973b 100644
> --- a/winsup/cygwin/exceptions.cc
> +++ b/winsup/cygwin/exceptions.cc
> @@ -645,7 +645,7 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
>      me.andreas->leave ();	/* Return from a "san" caught fault */
>  #endif
>  
> -  if (debugging && ++debugging < 500000)
> +  if (debugging && ++debugging)

This is not the right fix.  debugging is still a bool and you changed
the condition just to get rid of the warning.  The right fix is to keep
the condition and change the type of debugging to, e.g, int.  The
gnu_inline snippets are ok, but I'd like to see a description of what
effect this is fixing in the git comment, for future reference.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20160212/a7105e02/attachment.sig>


More information about the Cygwin-patches mailing list