On Wed, 20 Nov 2019 22:38:30 +0200 Janne Blomqvist wrote: > On Wed, Nov 20, 2019 at 8:00 PM Bernhard Reutner-Fischer > wrote: > > > > On 19 November 2019 23:54:55 CET, Thomas Koenig wrote: > > >Am 19.11.19 um 11:39 schrieb Bernhard Reutner-Fischer: > > >> + char name[GFC_MAX_SYMBOL_LEN + 1]; > > >> + snprintf (name, GFC_MAX_SYMBOL_LEN, "__dummy_%d_%s", var_num++, > > >> + f->sym->name); > > >> + > > >> + if (gfc_get_sym_tree (name, ns, &symtree, false) != 0) > > >> > > >> (I) you should + sizeof(__dummy__) + 10 for unsigned long %d or the > > >like. > > > > > >GFC_MAX_SYMBOL_LEN is the maximum length of a gfortran symbol. AFAIK, > > > > This is only true for user-provided names in the source code. > > > > Think e.g. class names as can be seen in the dumps.. > > We have GFC_MAX_MANGLED_SYMBOL_LEN for that. *Insert my standard pet > peeve rant that we should use heap allocated unlimited length strings > for these rather than copying stack allocated strings around, or > preferable a symbol table* yea, which i started to lay grounds to address that in https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/aldot/fortran-fe-stringpool about a year ago ;) Reminds me: i had to change the symbol names that are persisted in module-files to make it work; Still not sure if that's acceptable so if somebody would be willing to lend me a hand for sanity-checking that aspect of the series i'd be glad. Would certainly help to trick me into continuing the thing now, during winter. Looks like i've another memory leak plug lying around on that tree that i didn't try to push yet; It's the hunk in gfc_release_symbol() in the attached brain-dump i think, don't remember and should revisit to have it fixed for good i suppose.. > > > >it > > >is not possible to use a longer symbol name than that, so it needs to > > >be > > >truncated. Uniqueness of the variable name is guaranteed by the var_num > > >variable. > > > > > >If the user puts dummy arguments Supercalifragilisticexpialidociousa > > >and > > >Supercalifragilisticexpialidociousb into the argument list of a > > >procedure, he will have to look at the numbers to differentiate them > > >:-) > > > > > >> (II) s/__dummy/__intent_in/ for clarity? > > > > > >It's moved away a bit from INTENT(IN) now, because an argument which > > >cannot be modified (even by passing to a procedure with a dummy > > >argument > > >with unknown intent) is now also handled. > > > > So maybe __readonly_ , __rdonly_, __rd_or the like? dummy is really misleading a name in the dumps.. > > Well, dummy is a term with a precise definition in the Fortran > standard, so in a way it's good so one realizes it has something to do > with a dummy argument. But yes, it's a bit misleading because it's not > the dummy argument itself but rather a dereferenced copy of it. I > suggest __readonly_dereferenced_dummy_copy_yes_this_is_a_really_long_name_. > :) :) __rodummy_ then? but bikeshedding either way, so, Thomas, please go for __dummy_ short of sensible alternatives. cheers,