Ian Lance Taylor wrote:

Mike Stump <[EMAIL PROTECTED]> writes:

On Jul 4, 2006, at 5:18 PM, Andrew Pinski wrote:
And I posted a patch to do the same in Objective-C mode as C mode :).
http://gcc.gnu.org/ml/gcc-patches/2004-08/msg01013.html
Is the reason that Objective-C was excluded been fixed?  If so, while
I don't like the semantics in place now, I'd rather have consistency
with C/C++.  :-(

A version of Andrew's patch was checked in on 2005-05-24, by Ziemowit
Laski.  The languages are currently consistent.

Ian
If so, why I'm able to compile the casted pointer example with gcc-4.2-20060701 snapshot
in objective-c mode without warning/trap inserted?

Exactly speaking, all four front-ends behave different.

[EMAIL PROTECTED] ~/tmp $ cat bbb1.c
static double foo(double arg)
{
 return arg;
}

int bar(int d)
{

 d = ((int (*) (int)) (void(*)())foo)(d);
 return d*d;
}

[EMAIL PROTECTED] ~/tmp $ gcc -v
gcc version 4.2.0-alpha20060701  (experimental) (Gentoo 4.2.0_alpha20060701)
[EMAIL PROTECTED] ~/tmp $ gcc -O3 bbb1.c -c
bbb1.c: In function 'bar':
bbb1.c:9: warning: function called through a non-compatible type
bbb1.c:9: note: if this code is reached, the program will abort
[EMAIL PROTECTED] ~/tmp $ gcc -x c++ -O3 bbb1.c -c
[EMAIL PROTECTED] ~/tmp $ gcc -x objective-c -O3 bbb1.c -c
bbb1.c: In function 'bar':
bbb1.c:7: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
[EMAIL PROTECTED] ~/tmp $ gcc -x objective-c++ -O3 bbb1.c -c
bbb1.c: In function 'int bar(int)':
bbb1.c:6: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.

Reply via email to