Julien Cristau, le Fri 07 Jan 2011 12:00:40 +0100, a écrit :
> On Fri, Jan  7, 2011 at 00:31:07 +0100, Ferenc Wagner wrote:
> > Ferenc Wagner <wf...@niif.hu> writes:
> > 
> > > -            execvp("udhcpc", arguments);
> > > +            /* execvp doesn't like const strings for no reason, so we can
> > > +               cast away the const to suppress the compiler warning */
> > > +            execvp("udhcpc", (char **)arguments);
> > 
> > Actually, I started to feel bad about this part.  Maybe it would be
> > wiser to use non-const strings from the beginning?  That would require a
> > larger patch, though...  And ignoring the warning hasn't caused any
> > trouble yet.  Does anybody know why execvp hates const strings?
> 
> execvp takes 'char *const argv[]', not 'const char **argv'.

Also note that for subtle reasons in C, qualifiers after two levels of
indirection end up by definition to incompatible types.

Samuel


-- 
To UNSUBSCRIBE, email to debian-boot-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110107111446.gc5...@const.bordeaux.inria.fr

Reply via email to