On Fri, Jul 26, 2013 at 5:05 PM, Jonathan Schleifer <[email protected]> wrote: > Am 27.07.2013 um 01:54 schrieb John McCall: >> >> The feature enables users to rely on arbitrary message forwarding >> if they're willing to live on certain minimum compiler and runtime versions. >> That’s a pretty simple and comprehensible message for users. >> ... >> The policy of clang is not to introduce __has_feature checks for bug fixes. ... > This, however, is different. It will mean that using an old Clang version or > GCC will generate *crashing code* instead of a feature being unavailable. > That's a completely different thing! > > Crashing code is *totally* inacceptable! GNU used to be ok with crashing > code (there was a lot in their runtime that just crashed one some CPU > architectures), but that doesn't mean we need to be as bad as they were. > IMHO, code should never crash, period. It should check for the define I > provide and if it absolutely relies on the feature error out, or of it's > optional disable it.
Jonathan, I don't think that's a good argument. You've already pointed out that the test for "does Clang support this feature" is as simple as "#if defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))". You object that such a test would leave out bleeding-edge versions of Clang between now and the 3.4 release; but that's a very short-term problem that will go away in a few months, whereas __has_feature() introduces a problem that will by definition be around for the rest of everyone's life. (Besides, this is Objective-C. The Objective-C compiler is a fast-moving target, and generates silly and/or crashy code on a regular basis for sufficiently obscure constructs. Forwarding a method that returns a struct by value, using a particular non-Apple non-GNU runtime and a particular compiler built from source within a small time window, seems like the very definition of "sufficiently obscure".) my $.02, –Arthur _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
