Eray Aslan via Postfix-devel:
> Hi,
> 
> With postfix-3.8-20230314:
> 
> clang -fPIC -I. -I../../include -DHAS_PCRE=2 -DUSE_TLS -DHAS_LMDB -DNO_NIS 
> -DNO_DB -DDEF_DB_TYPE=\"lmdb\" -DHAS_CDB -I/usr/include/cdb -DHAS_DEV_URANDOM 
> -DSNAPSHOT -DDEF_SHLIB_DIR=\"/usr/lib64/postfix/\${mail_version}\" 
> -DUSE_DYNAMIC_LIBS -UUSE_DYNAMIC_MAPS -Wmissing-prototypes -Wformat 
> -Wno-comment -fno-common  -O2 -march=native -I. -I../../include -DLINUX6 -c 
> smtp_proto.c
> 
> I am getting
> 
> smtp_proto.c:1200:39: warning: implicit truncation from 'int' to a one-bit 
> wide bit-field changes value from 1 to -1
>       [-Wsingle-bit-bitfield-constant-conversion]
>                     state->logged_line_length_limit = 1;
>                                                     ^ ~
> 1 warning generated.
> 
> It is nit in the sense that it is still not zero and hence no change in
> behaviour. GCC gives a similar warning with -Wpedantic. Still, it might
> be a good idea to change logged_line_length_limit from int to unsigned.
> 
> -- 
> Eray
> 
> diff --git a/src/smtp/smtp.h b/src/smtp/smtp.h
> index 0864313..8f86425 100644
> --- a/src/smtp/smtp.h
> +++ b/src/smtp/smtp.h
> @@ -204,7 +204,7 @@ typedef struct SMTP_STATE {
>       * One-bit counters to avoid logging the same warning multiple times per
>       * delivery request.
>       */
> -    int     logged_line_length_limit:1;
> +    unsigned     logged_line_length_limit:1;
>  } SMTP_STATE;
> 
>   /*

And all this is because C did not have a proper boolean type. I'll
change this but do ot expected any effort to shut up warnings that
result from compiler settings.

        Wietse
_______________________________________________
Postfix-devel mailing list -- postfix-devel@postfix.org
To unsubscribe send an email to postfix-devel-le...@postfix.org

Reply via email to