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: [Patch, fortran] PR25018 - ICE in parameter initialization - and PR25029 - assumed size pointer assignments


Thank you Steve and Paul,

I will incorporate your comments.

In fact, I want to withdraw the second half of this patch, if that is acceptable to you, because I am most of the way to sorting out all the restrictions on assumed size arrays.

As well as PR25029, there are PR20868 and PR20870, together with a number of incipient bugs that a read of the standard rought to light. With 75% of a complete patch in place, I found that gfortran.dg/pr15140.f90 possesses a no-no; it contains an array reference to an assumed size array without the last upper bound. Ifort and Lahey agree.

function M(NAMES)
CHARACTER*(*) NAMES(*)
if (any(names.ne."asdfg")) call abort ! <<< I will add the required bound to fix it.
m = LEN(NAMES(1))
END function M


character(5) :: c(2)
c = "asdfg"
if(m(c).ne.5) call abort()
end


I don't think it's necessary to meantion the standard at all, that's implied by the fact we're generating an error. It's hardly likely that the user thinks we're enforcing the C standard :-)
"Assumed length variable '%s' not permitted in constant expression at $L"


What I was trying to do there was to indicate a difference between a warning/error that arises from application of the standard, from those that are plain wrong in any circumstances. Would you prefer "Extension: assumed length variable '%s' in constant expression at $L"; a style, which is used elsewhere in gfortran?

Cheers

Paul


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