This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] cygwin: fix errors with GCC 5


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)
     {
       SetThreadPriority (hMainThread, THREAD_PRIORITY_NORMAL);
       return ExceptionContinueExecution;
diff --git a/winsup/cygwin/include/cygwin/config.h b/winsup/cygwin/include/cygwin/config.h
index 58cff05..204826d 100644
--- a/winsup/cygwin/include/cygwin/config.h
+++ b/winsup/cygwin/include/cygwin/config.h
@@ -43,6 +43,7 @@ extern "C" {
 #else
 #include "../tlsoffsets.h"
 #endif
+__attribute__((gnu_inline))
 extern inline struct _reent *__getreent (void)
 {
   register char *ret;
diff --git a/winsup/cygwin/winbase.h b/winsup/cygwin/winbase.h
index 666f74a..1e825e4 100644
--- a/winsup/cygwin/winbase.h
+++ b/winsup/cygwin/winbase.h
@@ -11,6 +11,7 @@ details. */
 #ifndef _WINBASE2_H
 #define _WINBASE2_H
 
+__attribute__((gnu_inline))
 extern __inline__ LONG
 ilockcmpexch (volatile LONG *t, LONG v, LONG c)
 {
@@ -30,6 +31,7 @@ ilockcmpexch (volatile LONG *t, LONG v, LONG c)
 #undef InterlockedCompareExchangePointer
 
 #ifdef __x86_64__
+__attribute__((gnu_inline))
 extern __inline__ LONGLONG
 ilockcmpexch64 (volatile LONGLONG *t, LONGLONG v, LONGLONG c)
 {
-- 
2.7.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]