[neomutt-devel] [PATCH] add -Werror and -pedantic build flag; fix warnings

Richard Russon rich at flatcap.org
Sat Mar 6 13:23:09 CET 2021

> I'm sorry for the additional work i'm creating here but i have trouble
> configuring/authentificating my github so i can't send a pull request.

> -CFLAGS=		@CPPFLAGS@ @CFLAGS@ -I. -I at srcdir@ -Wall $(EXTRA_CFLAGS)
> +CFLAGS=		@CPPFLAGS@ @CFLAGS@ -I. -I at srcdir@ -Werror -pedantic -Wall $(EXTRA_CFLAGS)

Locally, I always build with `-Werror -pedantic` enabled,
but this is changing the build for everyone...

whatever their architecture, OS, compiler, compiler version.

I don't want to cause build failures that might only get discovered when
packagers try to build NeoMutt after a release.

> -  char b64[1024] = { 0 };
>    char buf[1024] = { 0 };
> +  char b64[1022] = { 0 }; // 2 less bytes so \r\n fits into it


> -      snprintf(buf, sizeof(buf), "apple%ld", i);
> +      snprintf(buf, sizeof(buf), "apple%d", i);

No.  `size_t` is a *long* type.
Technically, we should use `%zu` for `size_t` -- see printf(3).

    Rich / FlatCap
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/attachments/20210306/327ff97c/attachment.sig>

More information about the neomutt-devel mailing list