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: C++ PATCH:


Gabriel Dos Reis wrote:

Lower forms appear because currently we do not do a good in the
front-end and pretty-printer telling which level of abstraction is
preferred. I noted initial effort in that direction has already been undermined by you. Since, no technical reason was given, I must
assume it is political.

I really wanted to avoid a flame war with you.


But, I don't see how I can fail to respond to this statement. I don't have any idea to what you're referring, and I certainly don't have any "political" reasons for approving or disapproving patches with respect to lowering in the C++ front end. In fact, I've long championed having a high-level and low-level representation. (Though I don't think even the high-level representation need allow one to reconstruct the source code, parenthesis-for-parenthesis.)

That statement is factually false as can be verified with EDG-3.5:

   "b.C", line 3: error: expected an expression
        if (int i = {0})
                    ^

I've worked extensively on and with the EDG front end, and have a very good idea how it works.


That's printed by having accurate source position information, and then printing the relevant line from the source file. It is not printed by dumping a representation of EDG's internal form of an expression. That is precisely what I meant by "using carets"; the caret wouldn't be very useful if you didn't also print the line to which it refers. I think this method of referencing expressions is far more useful -- and robust -- than the G++ method of trying to reconstruct the expression from its internal representation. I don't think that if the user writes
"(1+ 2) *(a * (b))" we're likely to have a representation that can faithfully reproduce that; simply pointing at the relevant source code seems better.


Before deciding on whether it is just another obstructionism from your part, it would be useful to know if you oppose just to statement
expressions or any kind of statement.

In principle, I oppose printing (i.e., reconstructing from our internal representation) any kind of expression or statement, excluding declarations. (In other words, I'm happy with the %D and %T formats, but not the %E format.)


In practice, we've printed expressions for a long time, and until someone develops the caret machinery, we need to keep doing that. I don't see any reason to print any kind of statement, though. Given the current state of our internal representation, we're even more likely to emit things that are confusing to the user.

> If it is another instance of
of maintainerhisp abuse based on fallacy, contrary to GCC mission
statement you're probably right.

I'm sorry you feel so wronged, but I find the insults that you've put in this email to be totally inappropriate. If you don't think I'm fit to be a C++ maintainer, ask the SC to remove me. If you don't think I'm doing a good job as a C++ maintainer, please bring that up with me, publicly or privately, and explain what you think I'm doing wrong. But why do you think that insulting me will change anything for the better?


In this case, I don't feel that expressing my opinion about how to display C++ diagnostics -- a front end for which I am a co-maintainer -- is an abuse of that position. In fact, I specifically said that you might be able to convince other maintainers otherwise, suggesting that I would bend to the will of the majority, if you were successful.

Perhaps you object to me having made up my mind before a long email discussion with you. Since I've worked on C++ compilers for over a decade, I've come to a lot of conclusions about how to do things that are relatively unshakable. It's not as if I just thought about this issue for the first time last night; I've thought about this problem for years, looked at what various compilers have done, talked with users, etc. I've also fixed numerous bugs in the G++ expression-printers. (However, I've never had the time or energy to work through the process of implementing the caret approach, which is definitely a lot of work, and would necessarily include working through issues about the GNU standards for error messages, etc.)

When I've made up my mind, I think it's a lot more useful to tell you that, than to waste everyone's time pretending I've not come to a conclusion. Even then, I'm always willing to be persuaded otherwise -- but the way to do that is to write a well-reasoned description of why I'm wrong that convinces others. If lots of other people think differently, that's a suggestion I should rethink my position.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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