http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51808

             Bug #: 51808
           Summary: Improve handling of ISO_C_BINDING binding names
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: j...@gcc.gnu.org


Currently in gfc_symbol we have a field binding_label for the bind(C) binding
name. It is a char[] array of size 127. This is suboptimal because

1) For the vast majority of symbols which are not bind(C, name="XXX"), this
wastes memory.

2) It might be too short. Fortran limits the length of names to 63 characters,
but the binding name is not a Fortran identifier. The C standard says that the
implementation should support external identifiers with at least 31 characters,
but an implementation is free to support arbitrarily long identifiers.

Thus, we should get rid of the notion of limited binding label lengths, and use
dynamically allocated storage. 

Also, slightly related, for .mod files a non-empty binding_label field is
needed only if the default name is overridden, saving a bit of space.

If time permits, I'm planning to look into this for the 4.8 cycle.

Reply via email to