public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] difftime is pure, not const
@ 2024-05-27 16:10 Paul Eggert
  0 siblings, 0 replies; only message in thread
From: Paul Eggert @ 2024-05-27 16:10 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=df63f01a30d98f74bb6e82cbe1e27dbf795e433d

commit df63f01a30d98f74bb6e82cbe1e27dbf795e433d
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Sun May 26 17:37:17 2024 -0700

    difftime is pure, not const
    
    Because difftime's behavior depends on the floating-point environment,
    the function is pure, not const (BZ 31802).
    
    Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

Diff:
---
 time/time.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/time/time.h b/time/time.h
index bc043188e1..486367f7dd 100644
--- a/time/time.h
+++ b/time/time.h
@@ -77,7 +77,7 @@ extern time_t time (time_t *__timer) __THROW;
 
 /* Return the difference between TIME1 and TIME0.  */
 extern double difftime (time_t __time1, time_t __time0)
-     __THROW __attribute__ ((__const__));
+     __THROW __attribute_pure__;
 
 /* Return the `time_t' representation of TP and normalize TP.  */
 extern time_t mktime (struct tm *__tp) __THROW;
@@ -85,7 +85,7 @@ extern time_t mktime (struct tm *__tp) __THROW;
 # ifdef __REDIRECT_NTH
 extern time_t __REDIRECT_NTH (time, (time_t *__timer), __time64);
 extern double __REDIRECT_NTH (difftime, (time_t __time1, time_t __time0),
-                              __difftime64) __attribute__ ((__const__));
+                              __difftime64) __attribute_pure__;
 extern time_t __REDIRECT_NTH (mktime, (struct tm *__tp), __mktime64);
 # else
 #  define time __time64

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-27 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-27 16:10 [glibc] difftime is pure, not const Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).