------- Comment #59 from redi at gcc dot gnu dot org 2010-08-14 17:10 ------- (In reply to comment #58) > > (is Chris your friend?)
Of course not. I have no idea who he is. > > Are you confusing me with Michael? I've not said anything about LDT. > > Yes I am. I'm sorry for that, I really am. I got mixed up. We were discussing > the post and I didn't check the sender. There are just too many of you guys. > I'm sorry, this comment wasn't meant for you (I must be getting tired). See, you talk crap? (I'm responding like that because that's your manner of response, you attack and you insult and you aren't even paying attention to what you're replying to.) > > What am I supposed to admit? That GCC compiles valid C++ code? > > You don't have to admit anything really. But in your comment #34 to bug #45249 > you missed the point entirely and just spewed out standards. You missed the > point really, as I was saying "GCC can't", and it really can't. Spewing out > standards just to explain "GCC can't because <insert standards here>" was not > really useful for that discussion. Does not make an idiot out of you though. GCC *could* compile invalid code, if we wanted it to, but it doesn't. That's by design, not due to accident or inability to make it work. Several other C++ compilers don't compile it either. The reason is because they aim to follow the relevant standards. And so that's why I referenced the standard. > Then you claimed <What a charming idea, that a compiler could become perfect > by > doing "what I said it should">. And that is very close to making an idiot out > of you, because you deflected without getting the background for the > conversation straight. I had to show you (again) that <you failed to see that > "what I say" is what "C99+cdecl" say>. Yes, that was sarcasm, in the (apparently wrong) hope that you'd get a hint and go away. > > You keep accusing GCC of not compiling useful C++ code, but haven't shown a > > valid example yet. > > Yes I have. It is there on Wikipedia. The code compiled is not valid (in a > functional sense) because the programmer cannot trust the pointer difference. > Maybe at this point you get confused because you didn't type "valid [according > to standards] example", but you didn't type it. So valid is open for > discussion. And I say that is valid if it returns 0x4000-0x3000=0x1000. The ISO C and C++ standards say what's valid in this context, not you. > So there you go, now you're an idiot like Michael (well, still less, your > error > rate is much lower and of much less significance). You are an idiot because > you > don't know what "valid" is to everyone, you just think you do because you know > of some standard that says what is "valid" in a given context. I do assembly > inside my C code with MSC, is that not "valid" because it is not defined in > any > C standard? Nope. It is "valid", no matter how much you kick and scream. No, in the context of a compiler which tries to conform to the ISO standard, the ISO standard is the definition of what's valid. > With the same train of thought I could talk about initializing classes as > parameters to functions as in comment #25 of bug #45249 (as another example I > posted and that you didn't see), because, again, you didn't explain what the > "valid" word in your text was supposed to mean. I know you mean standards, but > there is more to it. But this one does not make an idiot out of you because > "valid" is much harder to define here. So I'm am not in a position to spot the > level of idiocy in your comment (I'll just assume it is none). So I say > "valid" > (outside in the real world) and you say "invalid" (based on C standards), but > none of us are idiots for it. You are welcome to use any definition of valid in your personal conversations, but in the context of a compiler which aims to conform to the ISO standards you don't get to decide what the definition of valid is. And this bugzilla is, most certainly, in the context of GCC. If you want to discuss other uses of "valid" or non-standard code, do it somewhere else, such as the comp.lang.c newsgroup. G++ doesn't compile that code because the code is invalid, and binding non-const references to rvalues is unsafe, and C++ experts have decided that a conforming compiler should not allow it. One reason for that is the following: class X { int i; } X& f(X& x) { return x; } int main() { X& x1 = f( X() ); return x.i; } This code is unsafe because it accesses X::i after it has been freed. The standard says it's not allowed, and G++ implements that. You are free to say it should be different, but noone will agree with you. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45265