This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Kevin P. Fleming wrote:
There is one workaround that I've found, which is to call the macro like
this:

char str1[20], *str2;

	....
	str2 = S_OR(&str1, "");

This makes the 'promotion' to 'char *' explicit, and resolves the issue.

...but isn't the code wrong? typeof(&str1) =~ char**, not char*?


What about this (untested WAG):
typeof(*(&a)) __x = a;
- or -
typeof(&(a[0])) __x = a; // a must be pointer or array

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
In the beginning, there were not enough colors. -- Guy Keren


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]