This is the mail archive of the 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/ObjC++: updated documentation on supported standards, and added -fobjc-std=objc1

>> If we don't want to use "std", maybe I'd be happy with -fobjc- 
>> dialect=xxx.
> Mike OK'd it already ;-)

Yes, but that doesn't mean we can't discuss it further :-)

I think Mike approved it because the patch is good enough to go in (which
it is); if we come up with something better, or if someone has good objections,
we can always submit a revised patch, or a followup patch.

Having discussed it for a bit, I actually now quite like the original choice of -fobjc-std=objc1.
The reasons are:

 * it is similar to -fobjc-exceptions, which enables/disables @synchronized, @try/@catch/@finally.
So you'll find it in the same place in the GCC manual, and consistently starts with "-fobjc-" like
the new option and the other ObjC language options;

 * it is similar to -std=xxx, but orthogonal to it, so you can for example use
"-std=c99 -fobjc-std=objc1" or "-std=gnu89 -fobjc-std=objc1" and get a different language (people 
who use these flags can get very hot about these things; if we have orthogonal flags for C/C++ and 
ObjC, we can make them happy no matter what combination they ask for);

 * it takes a short keyword as argument, so it should be robust if we need to add other language
dialects in the future;

 * inside the GCC source code, I used "if (flag_objc1_only)" to detect the case that Objective-C 1.0
was requested (which should be fairly self-explanatory, much more self-explanatory that "if (flag_gcc40)"), 
and I like the option having the same name (objc1) in the command-line option so it's easy to make
the association between "if (flag_objc1_only)" and "-fobjc-std=objc1"

I guess the only other main contendents would be -fobjc1-only (which I actually like to as it is clear
and immediately maps to "if (objc1_only)" in the code), but then if/when the language changes again 
we'd have to add another flag, and it's neater to have just one (-fobjc-std=...) with an enumeration
of the values.

Anyway, I'll wait another day or so for further comments or suggestions (which are very welcome)
before committing.


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