This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR31803 - Fix pointer => target(range)
- From: Tobias Burnus <burnus at net-b dot de>
- To: Brooks Moses <brooks dot moses at codesourcery dot com>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 04 May 2007 21:23:16 +0200
- Subject: Re: [Patch, fortran] PR31803 - Fix pointer => target(range)
- References: <463B2A73.70703@net-b.de> <463B6E6E.8010109@codesourcery.com>
Hi Brooks,
Thanks for being alert. I was happy to fix a rejects-valid crash, but of
cause one should have dug deeper to find and fix also this
accepts-invalid problem.
gfortran happily accepts your example where as NAG f95 prints:
Error: Differing length type parameters in pointer assignment
gfortran is by the way in good company as ifort and g95 also accept it.
(g95 prints the same: 'bcd' + garbage, ifort prints only 'bcd'.)
There is a very simple reason why ts.cl is NULL: primary.c's
match_varspec contains:
if (substring)
primary->ts.cl = NULL;
If one removes these lines, the proper error message is printed:
Error: Different character lengths in pointer assignment at (1)
The right way is to set ts.cl->length to the proper value if known at
compile time otherwise the whole string length and not the substring
length is used.
I created a new PR for this: PR31821
I also opened a new PR for run-time bound checking such substring
pointer assignments: PR31822
Tobias