This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_types_compatible_p and 'char *' vs. 'char []'
- From: "Kevin P. Fleming" <kpfleming at digium dot com>
- To: Matthew Woehlke <mw_triad at users dot sourceforge dot net>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 06 Nov 2008 21:06:05 -0600
- Subject: Re: __builtin_types_compatible_p and 'char *' vs. 'char []'
- Openpgp: id=05FB8DB2
- References: <49131E88.3010500@digium.com> <gevt9c$qpa$1@ger.gmane.org>
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.
--
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - "The Genuine Asterisk Experience" (TM)