[fortran,patch] Binding label can be any initialisation expression

FX fxcoudert@gmail.com
Sun Jun 8 22:33:00 GMT 2014


Well, only scalar character of the default kind, but still…

This patch achieves this goal by following the obvious plan, which has not changed since I wrote it in PR 36275 in 2008 :)
The custom matcher for binding label, in gfc_match_bind_c(), is removed and the generic matcher gfc_match_init_expr() is called, followed by checks that the expression obtained fulfills the constraints of a C identifier.

So, now is the time to think about PR 38839 (what characters to allow as a binding label): right now, I allow alphadecimals, underscore and dollar. From the PR comments, it seems like @ and ` might be also allowed for universal-character names, but they are not supported by GCC on platforms I tested right now. Let me know what you think, but I don’t think we should worry to much about it.

Bootstrapped and regtested on x86_64-apple-darwin13, comes with testcases.
OK to commit?

FX


PS: you may notice I have had some time to hack at gfortran these past few days... it feels good!


-------------- next part --------------
A non-text attachment was scrubbed...
Name: bind_c.ChangeLog
Type: application/octet-stream
Size: 480 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140608/0c5996ab/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bind_c.diff
Type: application/octet-stream
Size: 10523 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140608/0c5996ab/attachment-0001.obj>


More information about the Fortran mailing list