public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] difftime can throw exceptions
@ 2024-06-04 16:04 Paul Eggert
  0 siblings, 0 replies; only message in thread
From: Paul Eggert @ 2024-06-04 16:04 UTC (permalink / raw)
  To: glibc-cvs

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

commit cafef3eb21db24f2e8113b0adc12c0f15d4dec41
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Tue May 28 10:07:47 2024 -0700

    difftime can throw exceptions
    
    difftime can signal an inexact conversion when converting to double,
    so it should not be marked as pure or nothrow (BZ 31808).
    
    Although we could do something more complicated, in which difftime is
    plain on modern platforms but const and nothrow on obsolescent
    platforms with 32-bit time_t, it hardly seems worth the trouble.
    difftime is used so rarely that it's not worth taking pains to
    optimize calls to it on obsolescent platforms.
    
    Reviewed-by: DJ Delorie <dj@redhat.com>

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

diff --git a/time/time.h b/time/time.h
index 486367f7dd..b6b439a452 100644
--- a/time/time.h
+++ b/time/time.h
@@ -76,8 +76,7 @@ extern clock_t clock (void) __THROW;
 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_pure__;
+extern double difftime (time_t __time1, time_t __time0);
 
 /* Return the `time_t' representation of TP and normalize TP.  */
 extern time_t mktime (struct tm *__tp) __THROW;
@@ -85,7 +84,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_pure__;
+                              __difftime64);
 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-06-04 16:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-04 16:04 [glibc] difftime can throw exceptions 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).