Skip to content

Commit 8f5b703

Browse files
as51340jcar87
andauthored
cyrus-sasl: fix clang compiler error (#27911)
* Patch cyrus sasl * fixes * fix * fixes --------- Co-authored-by: Luis Caro Campos <[email protected]>
1 parent eb52d8b commit 8f5b703

File tree

5 files changed

+39
-71
lines changed

5 files changed

+39
-71
lines changed

recipes/cyrus-sasl/all/conandata.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ sources:
88
patches:
99
"2.1.28":
1010
- patch_file: "patches/0001-Fix-time.h.patch"
11-
patch_description: "patch"
12-
patch_type: "portability"
1311
- patch_file: "patches/0001-use-attr-on-gnu.patch"
14-
patch_source: https://github.com/cyrusimap/cyrus-sasl/commit/06f41c41e5c0f62ed5c1d703a9e2da42dfdb71f6
15-
patch_description: "Fix https://github.com/cyrusimap/cyrus-sasl/issues/831"
16-
patch_type: "official"
1712
"2.1.27":
1813
- patch_file: "patches/0001-use-attr-on-gnu.patch"
19-
patch_source: https://github.com/cyrusimap/cyrus-sasl/commit/06f41c41e5c0f62ed5c1d703a9e2da42dfdb71f6
20-
patch_description: "Fix https://github.com/cyrusimap/cyrus-sasl/issues/831"
21-
patch_type: "official"
Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,45 @@
1-
From 266f0acf7f5e029afbb3e263437039e50cd6c262 Mon Sep 17 00:00:00 2001
2-
From: Sam James <>
3-
Date: Wed, 23 Feb 2022 00:45:15 +0000
4-
Subject: [PATCH] Fix <time.h> check
5-
MIME-Version: 1.0
6-
Content-Type: text/plain; charset=UTF-8
7-
Content-Transfer-Encoding: 8bit
1+
Backport https://github.com/cyrusimap/cyrus-sasl/pull/709
82

9-
We're conditionally including based on HAVE_TIME_H in a bunch of places,
10-
but we're not actually checking for time.h, so that's never going to be defined.
11-
12-
While at it, add in a missing include in the cram plugin.
13-
14-
This fixes a bunch of implicit declaration warnings:
15-
```
16-
* cyrus-sasl-2.1.28/lib/saslutil.c:280:3: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
17-
* cyrus-sasl-2.1.28/lib/saslutil.c:364:41: warning: implicit declaration of function ‘clock’ [-Wimplicit-function-declaration]
18-
* cyrus-sasl-2.1.28/plugins/cram.c:132:7: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
19-
* cyrus-sasl-2.1.28/lib/saslutil.c:280:3: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
20-
* cyrus-sasl-2.1.28/lib/saslutil.c:364:41: warning: implicit declaration of function ‘clock’ [-Wimplicit-function-declaration]
21-
* cyrus-sasl-2.1.28/plugins/cram.c:132:7: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
22-
```
23-
24-
https://github.com/cyrusimap/cyrus-sasl/commit/266f0acf7f5e029afbb3e263437039e50cd6c262
25-
26-
--- a/lib/saslutil.c
27-
+++ b/lib/saslutil.c
28-
@@ -59,9 +59,7 @@
29-
#ifdef HAVE_UNISTD_H
30-
#include <unistd.h>
31-
#endif
32-
-#ifdef HAVE_TIME_H
33-
#include <time.h>
34-
-#endif
35-
#include "saslint.h"
36-
#include <saslutil.h>
3+
diff --git a/configure b/configure
4+
index 71dff1b..96e41c5 100755
5+
--- a/configure
6+
+++ b/configure
7+
@@ -20765,7 +20765,7 @@ $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
8+
9+
fi
10+
11+
-for ac_header in crypt.h des.h dlfcn.h fcntl.h limits.h malloc.h paths.h strings.h sys/file.h sys/time.h syslog.h unistd.h inttypes.h sys/uio.h sys/param.h sysexits.h stdarg.h varargs.h krb5.h
12+
+for ac_header in crypt.h des.h dlfcn.h fcntl.h limits.h malloc.h paths.h strings.h sys/file.h sys/time.h syslog.h time.h unistd.h inttypes.h sys/uio.h sys/param.h sysexits.h stdarg.h varargs.h krb5.h
13+
do :
14+
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
15+
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
3716

17+
diff --git a/plugins/cram.c b/plugins/cram.c
18+
index d02e9baa..695aaa91 100644
3819
--- a/plugins/cram.c
3920
+++ b/plugins/cram.c
40-
@@ -53,6 +53,7 @@
21+
@@ -53,6 +53,10 @@
4122
#endif
4223
#include <fcntl.h>
4324

25+
+#ifdef HAVE_TIME_H
4426
+#include <time.h>
27+
+#endif
28+
+
4529
#include <sasl.h>
4630
#include <saslplug.h>
4731
#include <saslutil.h>
32+
33+
index 8f2f1be..28f9c95 100644
34+
--- a/config.h.in
35+
+++ b/config.h.in
36+
@@ -304,6 +304,9 @@
37+
/* Define to 1 if you have the <string.h> header file. */
38+
#undef HAVE_STRING_H
39+
40+
+/* Define to 1 if you have the <time.h> header file. */
41+
+#undef HAVE_TIME_H
42+
+
43+
/* Define to 1 if you have the `strlcat' function. */
44+
#undef HAVE_STRLCAT
45+

recipes/cyrus-sasl/all/patches/0001-use-attr-on-gnu.patch

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
https://github.com/cyrusimap/cyrus-sasl/commit/06f41c41e5c0f62ed5c1d703a9e2da42dfdb71f6
2+
https://github.com/cyrusimap/cyrus-sasl/issues/831
3+
14
From 06f41c41e5c0f62ed5c1d703a9e2da42dfdb71f6 Mon Sep 17 00:00:00 2001
2-
From: Howard Chu <[email protected]>
5+
From: Howard Chu
36
Date: Wed, 24 Jul 2024 19:27:04 +0100
47
Subject: [PATCH] include: only use __attribute__ on Gnu C
58

69
It's a compiler-specific feature and we can't depend on other
710
compilers supporting it identically or at all.
811
Fix #831.
912

10-
Signed-off-by: Howard Chu <[email protected]>
13+
Signed-off-by: Howard Chu
1114
---
1215
include/prop.h | 6 ++++++
1316
1 file changed, 6 insertions(+)

recipes/cyrus-sasl/all/test_v1_package/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

recipes/cyrus-sasl/all/test_v1_package/conanfile.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)