Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: djgpp AT delorie DOT com Date: Fri, 9 May 1997 15:38:02 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: C++ front end bug Precedence: bulk Hi everybody: Here SET again with bad news. I'm comunicating bugs of GCC to the list because it can affect to somebody and I know how hard is to find a bug in a program when the fault is in the compiler. "Daniel W. Moore" reported a bug to the FSF in the C++ front end. Looks like a bug but perhaps is something related to C++. The following code outputs different results in C and C++. GCC just says that (void *)aa isn't equal to (void*)&aa, but if we ask for the value of each expression it return the same number. So is that a bug or is something related to C++? From my point of view the cast to (void *) must kill any difference and hence that's a bug. #include int aa[3]={7,8,9}; main() { int i; /* the following statements should print the same value twice */ printf("(void *)aa is %X and (void*)&aa is %X so they are %s equal!?!\n", (void *)aa,(void*)&aa,((void*) aa != (void*) &aa) ? "not" : ""); i = (((void*) aa != (void*) &aa) ? 0 : sizeof(aa)); printf(" %d\n", i); i = (((void*) aa == (void*) &aa) ? sizeof(aa) : 0); printf(" %d\n", i); return 0; } ------------------------------------ 0 -------------------------------- Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013