https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117381

kargls at comcast dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargls at comcast dot net

--- Comment #4 from kargls at comcast dot net ---
(In reply to Jordan from comment #3)
> I tested this:
> 
> program main
>   use, intrinsic :: iso_c_binding
>   implicit none
> 
>   integer ::
> VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR = 1
> end program main
> 
> with:
> gfortran -std=f95 -fmax-identifier-length=80 ./app/main.f90 
> 
> with result:
> f951: Fatal Error: Maximum supported identifier length is 63
> compilation terminated.

The option should likely by removed or the documentation improved.
It can be set to any value up to and including 63.  Anything larger
will not work.

% cd gcc/gcc/fortran
% grep GFC_MAX_SYMBOL_LEN *.cc | grep + | wc -l
     149

There are 149 instances of the symbol and many of those
appear in declarations of buffers such as in match.cc

   /* Match an ELSE IF statement.  */

   match
   gfc_match_elseif (void)
   {
     char name[GFC_MAX_SYMBOL_LEN + 1];

As a side note, the Fortran 2023 standard has a numbered constraint

   F2023:C601 (R603) The maximum length of a name is 63 characters.

which means a Fortran compiler is oblige to detect and report the
issue.

As an additional side note, you don't need to create a custom vulkan.
You can create a custom gfortran with this patch.

diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index dd599bc97a2..85f0597bed0 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -54,7 +54,7 @@ not after.

 /* Major control parameters.  */

-#define GFC_MAX_SYMBOL_LEN 63   /* Must be at least 63 for F2003.  */
+#define GFC_MAX_SYMBOL_LEN 127   /* Must be at least 63 for F2003.  */
 #define GFC_LETTERS 26         /* Number of letters in the alphabet.  */

 #define MAX_SUBRECORD_LENGTH 2147483639   /* 2**31-9 */

Change 127 to whatever you want.

Reply via email to