This is the mail archive of the gcc-patches@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: [objc] Warnings when -fobjc-exception is not used



Why is this only a warning? It seems to me that with a warning you're
suggesting to the user that everything is alright, but the exception
code will not work. Also the way I read the documentation in
c-family/c.opt, what you warn about should actually be an error:

; Nonzero means that we will allow new ObjC exception syntax (@throw,
; @try, etc.) in source code.
fobjc-exceptions
ObjC ObjC++ Var(flag_objc_exceptions)
Enable Objective-C exception and synchronization synta

In other words: @try/@throw/@synchronize without -fobjc-exceptions
should be a syntax error.

That is an excellent suggestion :-)


I had also wondered about it, and implemented it this way mostly because the code for the NeXT runtime
was already treating the lack of -fobjc-exceptions as a warning. My idea was simply to extend the same warnings
to the GNU runtime. But actually an error makes more sense.


I'll rework the patch and repost it (there is also a mistake in the patch I posted in that it is warning for @synchronized twice,
so please ignore it for now anyway) with a test case.


Thanks!


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