Subject: Re: toolchain/22118: make won't compile with -Wcast-qual
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: tech-toolchain
Date: 07/15/2003 20:01:46
mouse@Rodents.Montreal.QC.CA said:
> ...huh?  What's "gravely wrong" with
> 	v[2].iov_base = deconst("\n"); 

Sorry if this has already been said - I didn't read the whole thread.

In cases like the iov I'd probably prefer a union of a const and a non-const.
Code like
union cnc {
        const char *c;
        char *nc;
};
void mist(const char *x)
{
        union cnc a;
        char *b;

        a.c = x;
        b = a.nc;
}
gets compiled without a warning.

best regards
Matthias