aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/cmake/cmake/avoid-gcc-warnings-with-Wstrict-prototypes.patch
blob: 8b8d4802ee04275356369b4bafff6db47641446c (plain)
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
From 4bc17345c01ea467099e28c7df30c23ace9e7811 Mon Sep 17 00:00:00 2001
From: Andre McCurdy <armccurdy@gmail.com>
Date: Fri, 14 Oct 2016 16:26:58 -0700
Subject: [PATCH] CheckFunctionExists.c: avoid gcc warnings with
 -Wstrict-prototypes

Avoid warnings (and therefore build failures etc) if a user happens
to add -Wstrict-prototypes to CFLAGS.

 | $ gcc --version
 | gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
 |
 | $ gcc -Wstrict-prototypes -Werror -DCHECK_FUNCTION_EXISTS=pthread_create -o foo.o -c Modules/CheckFunctionExists.c
 | Modules/CheckFunctionExists.c:7:3: error: function declaration isn't a prototype [-Werror=strict-prototypes]
 |    CHECK_FUNCTION_EXISTS();
 |    ^
 | cc1: all warnings being treated as errors
 |

Upstream-Status: Pending

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
 Modules/CheckFunctionExists.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/CheckFunctionExists.c b/Modules/CheckFunctionExists.c
index 2304000..224e340 100644
--- a/Modules/CheckFunctionExists.c
+++ b/Modules/CheckFunctionExists.c
@@ -4,7 +4,7 @@
 extern "C"
 #endif
   char
-  CHECK_FUNCTION_EXISTS();
+  CHECK_FUNCTION_EXISTS(void);
 #ifdef __CLASSIC_C__
 int main()
 {
-- 
1.9.1