On Mon, 25 Oct 2021 08:43:09 +0200
Tobias Burnus <tob...@codesourcery.com> wrote:

> Hi Thomas,
> 
> On 25.10.21 07:47, Thomas Koenig via Fortran wrote:
> > what you're doing seems a useful clean-up, thanks.
> >
> > One point for discussion:  
> >> -match
> >> +static match
> >>   gfc_match_label (void)  
> > I have generally understood that the gfc_ prefix is for global variables
> > and functions only.  We do not always adhere to it (also since some
> > global functions were made static previously), but I think we should
> > stick to it, unless other people think otherwise :-)  
> 
> I concur – but there is also a good reason for always having a prefix:
> It makes it more unlikely that there are name clashes between the
> middle/backend end and the FE. – And those should be strictly avoided as
> it makes debugging (in the debugger) harder. (And in particular, same
> file names should be avoided.)
> 
> I think there is also some attempt to avoid same names in multiple FE,
> but that's not as strict as long as different binaries are produced and
> 'git grep' does also show the directory.
> 
> For the readability, it could be sometimes useful to know whether a
> function is a FE function or not.
> 
> Thus, I am not sure whether it is better to always have the prefix or
> not – there are arguments for either.

I would put it the other way round:
At least global functions (and variables) should use the gfc_ prefix to
ease debugging and grep.

That said, I deliberately did not rename any of the functions, also to
avoid needless churn.
thanks,

Reply via email to