Am 10.05.2018 um 14:20 schrieb Thomas Koenig:
Am 10.05.2018 um 12:33 schrieb Jonathan Wakely:
Should the fix for PR 84073 be documented, so that users whose code is
now rejected understand why, and how to fix it?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84073
https://gcc.gnu.org/gcc-8/porting_to.html#fortran
Sounds like a good idea.
Since I introduced this, I'll do it within a few days (unless, of
course, somebody beats me to it, which I won't mind :-)
OK, not a few days, but a few hours :-)
Here is the diff. OK to commit to gcc-docs?
Regards
Thomas
Index: porting_to.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-8/porting_to.html,v
retrieving revision 1.6
diff -u -r1.6 porting_to.html
--- porting_to.html 4 May 2018 06:35:39 -0000 1.6
+++ porting_to.html 10 May 2018 15:16:57 -0000
@@ -196,7 +196,31 @@
void foo_ (char*, int*, fortran_charlen_t);
</code></pre>
+<p>
+ Versions of gfortran prior to 8.1 wrongly accepted CHARACTER
+ variables with a length type parameter other than one as C
+ interoperable. For example, the code
+ <pre><code>
+ module mod
+ use iso_c_binding
+ type, bind(C) :: a
+ character(len=2,kind=c_char) :: b ! Wrong
+ end type a
+ character(len=2), bind(C) :: c ! Also wrong
+ end module mod
+ </code></pre>
+ was accepted. To achieve similar functionality, an array of
+ LEN=1 characters can be used, for example
+ <pre><code>
+ module mod
+ use iso_c_binding
+ type, bind(C) :: a
+ character(kind=c_char) :: b(2)
+ end type a
+ character(kind=c_char), bind(C) :: c(2)
+ end module mod
+ </code></pre>
+</p>
<h2 id="links">Links</h2>
-
</body>
</html>