]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-mail: message-parser: Fixed Clang 6.0 compiler warning.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 15 Feb 2018 22:41:25 +0000 (23:41 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 15 Feb 2018 22:42:17 +0000 (23:42 +0100)
Warning was:

index-mail.c:1182:3: warning: arithmetic on a null pointer treated as a cast
from integer to pointer is a GNU extension [-Wnull-pointer-arithmetic]
                message_parser_parse_body(data->parser_ctx,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../src/lib-mail/message-parser.h:95:28: note: expanded from macro
'message_parser_parse_body'
                (void *)((char *)context + CALLBACK_TYPECHECK(callback, \
                         ~~~~~~~~~~~~~~~ ^

src/lib-mail/message-parser.h

index 1d4ca12fd9ca9a479a07fbf6c2c356bc2af92b90..c6fa79ce32f55f662031d632fc870c7ee2e9d8af 100644 (file)
@@ -92,7 +92,7 @@ void message_parser_parse_body(struct message_parser_ctx *ctx,
 #define message_parser_parse_body(ctx, callback, context) \
          message_parser_parse_body(ctx, \
                (message_part_header_callback_t *)callback, \
-               (void *)((char *)context + CALLBACK_TYPECHECK(callback, \
+               (void *)((uintptr_t)context + CALLBACK_TYPECHECK(callback, \
                        void (*)(struct message_part *, \
                                struct message_header_line *, typeof(context)))))