This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: [PATCH, Fortran, pr78672, ctp1, v1] Gfortran test suite failures with a sanitized compiler


Hi Thomas,

I understand your argument when gfortran would have been written in C, but in
fact is it written in a C-style C++. One would be wondering at how many
locations a pure C compiler would error out on the gfortran code. Think about a
simple:

symbol_attribute attr = gfc_expr_attr (e);

This is C++, whether one likes it or not. "symbol_attribute" is a structure and
we are using a copy-constructor here. Well in fact, is the compiler hopefully
not using the copy-constructor but the one with move semantics.

I totally agree, that adding sophisticated C++ features would make gfortran
hard to read, given that those feature would be used only at a few locations.
But here I am only using concepts and code, that was already present. I do not
understand what all this fuzz is about. There is absolutely *nothing* new. The
old code needed a comment to make clear what was its purpose. The new one just
says it: Get me the abs-value of that damn wide_int. So what?

Regards,
	Andre

On Sat, 10 Dec 2016 16:34:09 +0100
Thomas Koenig <tkoenig@netcologne.de> wrote:

> Hi Andre,
> 
> I can only speak for myself, but in this case I think your argument
> 
> > Programming is about constant learning. So you are arguing, that things
> > should not improve? So that you don't have to learn something new?  
> 
> does not hold for adding C++ features to gfortran which have no clear
> benefit.
> 
> 
> There are cases when adding some C++ stuff it is easy to read and
> understand for a C programmer.  For example, it is fairly easy to guess
> what std::swap means, and optional arguments to functions are a concept
> that can be quite powerful.  I have done so myself on occasion.
> 
> I have chosen not to learn much C++, and use C and Fortran instead.  If
> people start adding too much C++ stuff to gfortran, then I will no
> longer be qualified to review patches and to maintain the relevant code
> parts.
> 
> Regards
> 
> 	Thomas


-- 
Andre Vehreschild * Email: vehre ad gmx dot de 


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