Re: [PATCH] Add a missing pure attribute

2024-09-15 Thread Paul Eggert
On 2024-09-15 02:25, Bruno Haible wrote: it can happen that you add the attribute in order to placate one GCC version and then another GCC version complains that you should not have added it. Yes, and if memory serves older GCC versions were pretty bad about this, and that caused me

Re: [PATCH] Add a missing pure attribute

2024-09-15 Thread Bruno Haible
Samuel Tardieu wrote: > Agreed. However since there are more than 50 static functions marked pure in > C files already, and this seems to be the only missed compiler warning in GCC > 14.2, I thought you were favoring the absence of warning. We added these attributes before we realized that - i

Re: [PATCH] Add a missing pure attribute

2024-09-15 Thread Samuel Tardieu
Bruno Haible writes: > No, thanks. This is a 'static' function. It is a waste of time for us > developers to add attributes in order to declare information that GCC > has already found out by itself. Agreed. However since there are more than 50 static functions marked pure in C files already, a

Re: [PATCH] Add a missing pure attribute

2024-09-14 Thread Bruno Haible
Hi, Samuel Tardieu wrote: > diff --git a/lib/readutmp.c b/lib/readutmp.c > index 0938a094cb..fd84a1e4de 100644 > --- a/lib/readutmp.c > +++ b/lib/readutmp.c > @@ -301,7 +301,7 @@ finish_utmp (struct utmp_alloc a) > > /* Determine whether A already contains an entry of type BOOT_TIME. */ > _GL

[PATCH] Add a missing pure attribute

2024-09-14 Thread Samuel Tardieu
* lib/readutmp.c (have_boot_time): Mark the function with _GL_ATTRIBUTE_PURE. GCC 14.2.0 complains about it missing when compiling GNU coreutils. --- ChangeLog | 5 + lib/readutmp.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2b35fe29

[PATCH] Add a missing pure attribute

2024-09-14 Thread Samuel Tardieu
* lib/readutmp.c (have_boot_time): Mark the function with _GL_ATTRIBUTE_PURE. GCC 14.2.0 complains about it missing when compiling GNU coreutils. --- ChangeLog | 5 + lib/readutmp.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2b35fe29