On Wed, Sep 27, 2023 at 10:30:27PM +0100, Andrew C Aitchison via Exim-users wrote:
> Ian's Local/Makfile end with:
> CFLAGS = -O2 -fstack-protector-strong $(WARNINGS) $(DEFS)
> ... ...
> EXTRALIBS_EXIM = -lspf2
> DEFS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_FORTIFY_SOURCE=2
> WARNINGS = -Wdate-time -Wformat -Wno-format-truncation -Werror
> LDFLAGS = -Wl,-z,relro
>
> and his make.log with:
> cc lmtp.c
> lmtp.c: In function ‘lmtp_write_command’:
> lmtp.c:244:48: error: unknown conversion type character ‘Y’ in format
> [-Werror=format=]
> 244 | DEBUG(D_transport|D_v) debug_printf(" LMTP>> %Y", &gs);
> | ^
> lmtp.c:244:37: error: too many arguments for format
> [-Werror=format-extra-args]
> 244 | DEBUG(D_transport|D_v) debug_printf(" LMTP>> %Y", &gs);
> | ^~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[2]: *** [Makefile:15: lmtp.o] Error 1
> make[2]: Leaving directory '/var/lib/git/exim/src/build-Linux-x86_64/transports'
> Commit 00392be0e7 (Fri Jul 7 00:40:43 2023 +0100) adds a
> non-standard % option to printf-like format strings which -Wformat
> does not like. Since Ian has enabled -Werror too, the compiler is
> going to abort. -Wformat has been enabled by default since about
> the time that --std=c99 became the default, so he has should either
> replace -Wformat with -Wno-format or
> add -Wno-error=format
> or
> just drop -Werror
>
> These allow lmtp.c and smtp.c to compile on my machine, but there are
> warnings in other areas so -Werror will still break the build.
>
> Going back to exim 4.96, there are 15 .c files that do not compile
> on my Ubuntu 23.04/Lunar box with
> CC=gcc -Werror -Wno-error=format
> so I am not sure why Ian was expecting to be able to build 4.97 with
> "-Werror".
I'll first address the question of my expectations, in the light of
other warnings when compiling vanilla git tree.
The answer there is that I keep my own patch for those, meticulously
maintained and ported forward for each release. I can post the patch
here if needed, though I know there can be no question of merging it
into the official tree. I go through this trouble because clean builds
are, in fact, *that* important to me.
Second: if you look at the definition of PRINTF_FUNCTION in
src/src/mytypes.h, *all* of the format checks have already been disabled
on OpenBSD because the compiler doesn't like another nonstandard
conversion there. How is it consistent to add a new one and leave the
checks enabled on other platforms?
Third, there is still the question why that code in lmtp.c is getting
compiled at all (without MACRO_PREDEF) when lmtp is disabled. If I can
get this one answered I'll know how to deal with the above.
An immodest meta-comment: usually one gets closer to the truth by
assuming I'm *not* a fool.
--
Ian
--
## subscription configuration (requires account):
##
https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at
http://www.exim.org/
## Please use the Wiki with this list -
http://wiki.exim.org/