1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
From c5f03820fc4f8c9910f52ab2ef951a6e32ed3ff1 Mon Sep 17 00:00:00 2001
From: Yaakov Selkowitz <yselkowi@redhat.com>
Date: Fri, 12 Feb 2016 11:17:35 -0600
Subject: [PATCH 3/4] cygwin: fix errors with GCC 5
GCC 5 switched from C89 to C11 by default. This implies a change from
GNU to C99 inline by default, which have very different meanings of
extern inline vs. static inline:
https://gcc.gnu.org/onlinedocs/gcc/Inline.html
Marking these as gnu_inline retains the previous behaviour.
winsup/cygwin/
* exceptions.cc (exception::handle): Change debugging to int to fix
an 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 | 4 ++--
winsup/cygwin/include/cygwin/config.h | 1 +
winsup/cygwin/winbase.h | 2 ++
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index c3a45d2..1627d43 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -637,7 +637,7 @@ EXCEPTION_DISPOSITION
exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
PDISPATCHER_CONTEXT dispatch)
{
- static bool NO_COPY debugging;
+ static int NO_COPY debugging = 0;
_cygtls& me = _my_tls;
#ifndef __x86_64__
@@ -808,7 +808,7 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
rtl_unwind (frame, e);
else
{
- debugging = true;
+ debugging = 1;
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.4
|