313cf5a
From be12f82cf1ca652b06995e84971c878621315d24 Mon Sep 17 00:00:00 2001
313cf5a
From: Lukas Slebodnik <lslebodn@redhat.com>
313cf5a
Date: Tue, 6 Dec 2016 18:07:43 +0100
313cf5a
Subject: [PATCH 3/4] WAF: Fix detection os sysname ...
313cf5a
MIME-Version: 1.0
313cf5a
Content-Type: text/plain; charset=UTF-8
313cf5a
Content-Transfer-Encoding: 8bit
313cf5a
313cf5a
Detection of sysname failed with stricter CFLAGS
313cf5a
"-Werrorr=implicit-function-declaration -Werror=implicit-int"
313cf5a
313cf5a
  Checking uname sysname type              : not found
313cf5a
  Checking uname machine type              : not found
313cf5a
  Checking uname release type              : not found
313cf5a
  Checking uname version type              : not found
313cf5a
313cf5a
../test.c: In function ‘main’:
313cf5a
../test.c:8:32: error: implicit declaration of function ‘printf’
313cf5a
    [-Werror=implicit-function-declaration]
313cf5a
                                printf("%s", n.sysname);
313cf5a
                                ^~~~~~
313cf5a
../test.c:8:32: warning: incompatible implicit declaration
313cf5a
    of built-in function ‘printf’
313cf5a
../test.c:8:32: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
313cf5a
313cf5a
Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
313cf5a
Reviewed-by: Andreas Schneider <asn@samba.org>
313cf5a
Reviewed-by: Ralph Boehme <slow@samba.org>
313cf5a
---
313cf5a
 buildtools/wafsamba/samba_conftests.py | 1 +
313cf5a
 1 file changed, 1 insertion(+)
313cf5a
313cf5a
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
313cf5a
index c9f8fdc0131838b44dc92196fa95c6b2f7aea506..72e432164984c7faa9bc93745d401b5c38849d37 100644
313cf5a
--- a/buildtools/wafsamba/samba_conftests.py
313cf5a
+++ b/buildtools/wafsamba/samba_conftests.py
313cf5a
@@ -438,6 +438,7 @@ def CHECK_UNAME(conf):
313cf5a
     ret = True
313cf5a
     for v in "sysname machine release version".split():
313cf5a
         if not conf.CHECK_CODE('''
313cf5a
+                               int printf(const char *format, ...);
313cf5a
                                struct utsname n;
313cf5a
                                if (uname(&n) == -1) return -1;
313cf5a
                                printf("%%s", n.%s);
313cf5a
-- 
313cf5a
2.11.1
313cf5a