On Tue, Dec 26, 2023 at 02:33:35PM -0500, pgnd via Postfix-devel wrote:
> lots of noisy warnings,
>
> grep missing-braces tmp.txt
> dict.c:627:38: warning: missing braces around initializer
> [-Wmissing-braces]
All these about initialising arrays of structures without braces around
each list of members:
> tls_misc.c:322:43: warning: missing braces around initializer
> [-Wmissing-braces]
For example:
static const NAME_CODE protocol_table[] = {
SSL_TXT_SSLV2, TLS_PROTOCOL_SSLv2,
SSL_TXT_SSLV3, TLS_PROTOCOL_SSLv3,
SSL_TXT_TLSV1, TLS_PROTOCOL_TLSv1,
SSL_TXT_TLSV1_1, TLS_PROTOCOL_TLSv1_1,
SSL_TXT_TLSV1_2, TLS_PROTOCOL_TLSv1_2,
TLS_PROTOCOL_TXT_TLSV1_3, TLS_PROTOCOL_TLSv1_3,
0, TLS_PROTOCOL_INVALID,
};
Which the compiler apparently (modulo whitespace) prefers to be:
static const NAME_CODE protocol_table[] = {
{ SSL_TXT_SSLV2, TLS_PROTOCOL_SSLv2 },
{ SSL_TXT_SSLV3, TLS_PROTOCOL_SSLv3 },
{ SSL_TXT_TLSV1, TLS_PROTOCOL_TLSv1 },
{ SSL_TXT_TLSV1_1, TLS_PROTOCOL_TLSv1_1 },
{ SSL_TXT_TLSV1_2, TLS_PROTOCOL_TLSv1_2 },
{ TLS_PROTOCOL_TXT_TLSV1_3, TLS_PROTOCOL_TLSv1_3 },
{ 0, TLS_PROTOCOL_INVALID },
};
These warnings don't show up either with clang or gcc on the systems I
use. They can be safely ignored. Perhaps some day we'll do something
about it, but for now, just turn them off by changing the compiler
warning flags.
If I enable "-Wall", I get the noisy warnings, and they can all be
disabled by adding:
-Wno-missing-braces
-Wmaybe-uninitialized
-Wunused-but-set-variable
-Wunused-function
to CCARGS.
[ The unused "cleanup_extract_internal" function could perhaps some day
be dropped. Its call sites went away in postfix-2.2-20041019. The
remaining warnings are not productive. ]
--
Viktor.
_______________________________________________
Postfix-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]