Bug 373799 - Compilation error with cyrus-sasl 2.1.26
Summary: Compilation error with cyrus-sasl 2.1.26
Status: RESOLVED FIXED
Alias: None
Product: kmailtransport
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-18 03:24 UTC by Daniel Schepler
Modified: 2017-01-03 17:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.4.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Schepler 2016-12-18 03:24:36 UTC
Compiling kmailtransport 16.12.0 gives several compilation errors:

[ 37%] Building CXX object kioslave/src/smtp/CMakeFiles/kio_smtp.dir/command.cpp.o
In file included from /home/daniel/src/kmailtransport/kmailtransport-16.12.0/kioslave/src/smtp/command.h:36:0,
                 from /home/daniel/src/kmailtransport/kmailtransport-16.12.0/kioslave/src/smtp/command.cpp:32:
/usr/include/sasl/sasl.h:228:35: error: typedef 'sasl_malloc_t' is initialized (use decltype instead)
 typedef void *sasl_malloc_t(size_t);
                                   ^
/usr/include/sasl/sasl.h:228:29: error: 'size_t' was not declared in this scope
 typedef void *sasl_malloc_t(size_t);
                             ^~~~~~
/usr/include/sasl/sasl.h:229:29: error: typedef 'sasl_calloc_t' is initialized (use decltype instead)
 typedef void *sasl_calloc_t(size_t, size_t);
                             ^~~~~~
/usr/include/sasl/sasl.h:229:29: error: 'size_t' was not declared in this scope
/usr/include/sasl/sasl.h:229:37: error: 'size_t' was not declared in this scope
 typedef void *sasl_calloc_t(size_t, size_t);
                                     ^~~~~~
/usr/include/sasl/sasl.h:230:38: error: 'size_t' has not been declared
 typedef void *sasl_realloc_t(void *, size_t);
                                      ^~~~~~
/usr/include/sasl/sasl.h:233:33: error: variable or field 'sasl_set_alloc' declared void
 LIBSASL_API void sasl_set_alloc(sasl_malloc_t *,
                                 ^~~~~~~~~~~~~
/usr/include/sasl/sasl.h:233:33: error: 'sasl_malloc_t' was not declared in this scope
/usr/include/sasl/sasl.h:233:48: error: expected primary-expression before ',' token
 LIBSASL_API void sasl_set_alloc(sasl_malloc_t *,
                                                ^
/usr/include/sasl/sasl.h:234:5: error: 'sasl_calloc_t' was not declared in this scope
     sasl_calloc_t *,
     ^~~~~~~~~~~~~
/usr/include/sasl/sasl.h:234:20: error: expected primary-expression before ',' token
     sasl_calloc_t *,
                    ^
/usr/include/sasl/sasl.h:235:20: error: expected primary-expression before '*' token
     sasl_realloc_t *,
                    ^
/usr/include/sasl/sasl.h:235:21: error: expected primary-expression before ',' token
     sasl_realloc_t *,
                     ^
/usr/include/sasl/sasl.h:236:17: error: expected primary-expression before '*' token
     sasl_free_t *);
                 ^
/usr/include/sasl/sasl.h:236:18: error: expected primary-expression before ')' token
     sasl_free_t *);
                  ^
make[2]: *** [kioslave/src/smtp/CMakeFiles/kio_smtp.dir/build.make:159: kioslave/src/smtp/CMakeFiles/kio_smtp.dir/command.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:357: kioslave/src/smtp/CMakeFiles/kio_smtp.dir/all] Error 2
make: *** [Makefile:139: all] Error 2

The cyrus-sasl version is 2.1.26 (without any patches).  It would appear the sasl.h header from that version is missing a #include <sys/types.h>.  I found I can work around the issue and get kmailtransport to compile by adding #include <sys/types.h> to kioslave/src/smtp/command.h.
Comment 1 Daniel Vrátil 2017-01-03 17:08:29 UTC
Git commit a8e9f253d291c30ec4fcbb6f3e6d842a8884d87b by Daniel Vrátil.
Committed on 03/01/2017 at 17:07.
Pushed by dvratil into branch 'Applications/16.12'.

Include sys/types.h before sasl.h to fix build against Cyrus-SASL 2.1.26

A known bug in that specific version of Cyrus-SASL. This has been fixed
in later versions, but there's no harm in including sys/types.h ourselves
to make this version work.
FIXED-IN: 5.4.1

M  +3    -0    kioslave/src/smtp/command.h

https://commits.kde.org/kmailtransport/a8e9f253d291c30ec4fcbb6f3e6d842a8884d87b