pe...@ixp.jp:
> On Feb/12.11:28:57, Wietse Venema wrote:
> > Jean-Christophe Delaye:
> > > "milter.c", line 546: non-constant initializer involving a cast
>  
> >     545 static ATTR_OVER_TIME time_table[] = {
> >     546     7 + VAR_MILT_CONN_TIME, DEF_MILT_CONN_TIME, 0, 1, 0,
> >     ...
> > And mail_params.h has:
> >     #define VAR_MILT_CONN_TIME              "milter_connect_timeout"
> >     #define DEF_MILT_CONN_TIME              "30s"
> > You may try if "VAR_MILT_CONN_TIME + 7" works better.
> 
>       Indeed this works here. Putting quotes around the expression is
>       sufficient to placate 12.4, although this results in this
>       appearing in libmilter.a

DON'T DO THAT. Putting quotes around the expression is totally
incorrect.

Given the definition

    #define VAR_MILT_CONN_TIME  "milter_connect_timeout"

the expression

    7 + VAR_MILT_CONN_TIME

expands into

    7 + "milter_connect_timeout"

A correct compiler will evaluate this as

    "connect_timeout"

With a buggy compiler, this form may work:

    545 static ATTR_OVER_TIME time_table[] = {
    546     &(VAR_MILT_CONN_TIME[7]), DEF_MILT_CONN_TIME, 0, 1, 0,
    ...

But I would not be surprised when the compiler mis-handles this as
well, because both forms do the same thing: take the address of
the 8th octet in a byte array.

        Wietse

Reply via email to