Skip to content

Commit

Permalink
Fix <time.h> check
Browse files Browse the repository at this point in the history
We're conditionally including based on HAVE_TIME_H in a bunch of places,
but we're not actually checking for time.h, so that's never going to be defined.

While at it, add in a missing include in the cram plugin.

This fixes a bunch of implicit declaration warnings:
```
 * cyrus-sasl-2.1.28/lib/saslutil.c:280:3: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
 * cyrus-sasl-2.1.28/lib/saslutil.c:364:41: warning: implicit declaration of function ‘clock’ [-Wimplicit-function-declaration]
 * cyrus-sasl-2.1.28/plugins/cram.c:132:7: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
 * cyrus-sasl-2.1.28/lib/saslutil.c:280:3: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
 * cyrus-sasl-2.1.28/lib/saslutil.c:364:41: warning: implicit declaration of function ‘clock’ [-Wimplicit-function-declaration]
 * cyrus-sasl-2.1.28/plugins/cram.c:132:7: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
```

Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
thesamesam authored and quanah committed Mar 1, 2022
1 parent fdcd13c commit 266f0ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ AC_CHECK_HEADERS_ONCE([sys/time.h])

AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(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)
AC_CHECK_HEADERS(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)

IPv6_CHECK_SS_FAMILY()
IPv6_CHECK_SA_LEN()
Expand Down
4 changes: 4 additions & 0 deletions plugins/cram.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
#endif
#include <fcntl.h>

#ifdef HAVE_TIME_H
#include <time.h>
#endif

#include <sasl.h>
#include <saslplug.h>
#include <saslutil.h>
Expand Down

0 comments on commit 266f0ac

Please sign in to comment.