This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] fix Objective-C, further improve error recovery for unknown type names
> You are right. However, there would be a subtle change, in that the
> shiny new unknown type name error would be disabled in C 'for' loop
> initial declarations, same as it is disabled for Objective C:
Thanks - you are right - I hadn't noticed that.
The C and Objective-C compilers should really behave identically when
parsing non-Objective-C things (such as a standard 'for' loop). If
your patch intentionally breaks that, it's a problem. ;-)
> This can be fixed by adding a c_dialect_objc check to
> c_parser_next_tokens_start_declaration (after which you can do what you
> suggest). You can even get the new error to work for ObjC if you check
> for RID_IN. However, I'll leave it for a separate patch, possibly
> written by somebody with more interest in Objective-C. :)
I think you should add the missing checks that you describe to restore
having the same behaviour in C and Objective-C; it probably would have
taken you less time to fix your patch than to write the changes in an
email to get me to fix it for you ;-)
But you're actually worrying me as I'm now fearful that many more differences
between C and ObjC may have been introduced. Maybe we should run the C
testsuite with the compiler in ObjC mode ?