Re: const fixes seek commit approval




Havoc Pennington <rhpennin@midway.uchicago.edu> writes:

> OK, you have convinced me to be at least kind of neutral on the issue, and
> I want to go ahead and get the const args stuff in. So I will commit a
> const args patch tomorrow or so when I get back to a computer I can
> compile stuff on, if there are no objections by then. 
> 
> One remaining issue, what do you think of this kind of return value:
> 
> gtk_label_get(GtkLabel*, char** text);
> 
> I changed this to const char**, as you might predict. Is this a return
> value or an arg for the purposes of redoing the patch? It looks to me like
> it has the disadvantages (and advantages) of each, sadly. Sigh. 

It seems logical that you should be able to pass a 'char **' to
something expecting a const char **, but as you point out,
gcc doesn't like that.

In such cases, I've previously gone with the 'const', because
I'd rather put the onus of casting on the quick-and-dirty
crowd. 

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]