This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH PING: fix three libgcov warnings


Hi Nathan,

(Re-sending, as I think this message was lost.)

> sorry, I looked at this before, but got confused.  I don't understand how the
> type of execl's (char *[]) argument is relevant to the initialization of one of
> the elements of that array.  You're not changing the execl calls.

I probably spent more effort on that part of my explanation than was
necessary.  The point I was trying to make is that the cast cannot be
eliminated because the prototypes of the execl* and execv* functions
make it necessary to discard the const qualifier; no way around it.

The warning is produced because the existing cast to char * discards the
qualifier.  We need a cleverer way of discarding the const qualifier,
hence:

> -  args[0] = (char *) arg;
> +  args[0] = (void *) (intptr_t) arg;

I'm open to suggestions :-) (including adding a comment).

Cheers, Ben


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]