aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/timestamp.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-09-21 19:52:41 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-09-21 19:52:41 +0000
commite303a2dbe8c434bfc4b63830c9019a893ef507ba (patch)
tree2d095c702733eb3636fddcb2f668a20bbcba7f97 /src/backend/utils/adt/timestamp.c
parenteb3adab5685ce5a60bcf96628244f1e2a8e0ab3b (diff)
downloadpostgresql-e303a2dbe8c434bfc4b63830c9019a893ef507ba.tar.gz
postgresql-e303a2dbe8c434bfc4b63830c9019a893ef507ba.zip
Add last-ditch defense against attempts to compile datetime code with
-ffast-math.
Diffstat (limited to 'src/backend/utils/adt/timestamp.c')
-rw-r--r--src/backend/utils/adt/timestamp.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index bfdb7d06efc..2c8f882e384 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -1,14 +1,14 @@
/*-------------------------------------------------------------------------
*
* timestamp.c
- * Functions for the built-in SQL92 type "timestamp" and "interval".
+ * Functions for the built-in SQL92 types "timestamp" and "interval".
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.73 2002/09/04 20:31:29 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.74 2002/09/21 19:52:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -28,6 +28,14 @@
#include "utils/array.h"
#include "utils/builtins.h"
+/*
+ * gcc's -ffast-math switch breaks routines that expect exact results from
+ * expressions like timeval / 3600, where timeval is double.
+ */
+#ifdef __FAST_MATH__
+#error -ffast-math is known to break this code
+#endif
+
#ifdef HAVE_INT64_TIMESTAMP
static int64 time2t(const int hour, const int min, const int sec, const fsec_t fsec);