__builtin_types_compatible_p and 'char *' vs. 'char []'

Kevin P. Fleming kpfleming@digium.com
Fri Nov 7 17:11:00 GMT 2008


Matthew Woehlke wrote:

> Ah, yes, inline better than macro :-). I'd note that, from your example
> usage, it sounds like your return should also be const.

No, we have to return non-const, because many uses of this
macro/function are putting the result in a non-const variable. Returning
non-const is safe even if the lvalue accepting the result is const, but
the reverse generates a warning.

-- 
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - "The Genuine Asterisk Experience" (TM)



More information about the Gcc-help mailing list