This is the mail archive of the gcc@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]

__complex__ ?


I'm having some problems with the __complex__ gcc extension:

% uname -a
SunOS xx 5.5.1 Generic_103640-14 sun4u sparc SUNW,Ultra-1

% /home/sailer/local/egcs/bin/gcc -v
Reading specs from /home/sailer/local/egcs/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.02/specs
gcc version egcs-2.91.02 971216 (gcc-2.8.0)

But it's not version dependent. It is also true for all other
egcs versions I tried and at least gcc 2.7.2.1 as well. It's also
platform independent, I get the same errors/warnings on Linux/x86

void test(void)
{
	__complex__ short a[10];
	__complex__ short *b;

	b = a; /* line 6 */
}

__complex__ int c = 1i;
__complex__ int d = -1i; /* line 10 */
__complex__ int e = ~1i;
__complex__ int f = 0-1i;


% /home/sailer/local/egcs/bin/gcc -Wall -o egcstest.o egcstest.c
egcstest.c: In function `test':
egcstest.c:6: warning: assignment from incompatible pointer type
egcstest.c: At top level:
egcstest.c:10: initializer element is not constant


Why do I get the warning in line 6?
And why is -1i not constant, but 0-1i and ~1i are?

If it was intended that way, it should be documented 8)

Tom


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