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

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

 



(No need to CC me, I'm watching via gmane.)

Kevin P. Fleming wrote:
Matthew Woehlke wrote:
What about this (untested WAG):
typeof(*(&a)) __x = a;
- or -
typeof(&(a[0])) __x = a; // a must be pointer or array

I've changed to using a static inline function that accepts two 'const
char *' arguments and returns a 'char *' (casting internally to avoid
the compiler warning), which took care of the issue.

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

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
No .sig for you! NEXT! -- Unknown


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux