/ Check-in [8474cde3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add assertion check for NaN support at startup. (CVS 5447)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8474cde34b3fcb99cd5908fddb8528d0db331cdf
User & Date: shane 2008-07-22 05:13:30
Context
2008-07-22
05:15
Added comment on floating point precision compile option for MSVC. (CVS 5448) check-in: e20f2b8c user: shane tags: trunk
05:13
Add assertion check for NaN support at startup. (CVS 5447) check-in: 8474cde3 user: shane tags: trunk
05:05
"configure" support updated. Removed unused features. Added parsing of CFLAGS and CPPFLAGS to extract OMIT options to pass to lemon and mkkeywordhash. (CVS 5446) check-in: c67aa505 user: shane tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.479 2008/07/16 14:02:33 drh Exp $
           17  +** $Id: main.c,v 1.480 2008/07/22 05:13:30 shane Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include <ctype.h>
    21     21   
    22     22   #ifdef SQLITE_ENABLE_FTS3
    23     23   # include "fts3.h"
    24     24   #endif
................................................................................
   113    113       sqlite3StatusReset();
   114    114       inProgress = 1;
   115    115       rc = sqlite3_os_init();
   116    116       inProgress = 0;
   117    117       sqlite3Config.isInit = (rc==SQLITE_OK ? 1 : 0);
   118    118       sqlite3_mutex_leave(sqlite3Config.pInitMutex);
   119    119     }
          120  +
          121  +  /* Check NaN support. */
          122  +#ifndef NDEBUG
          123  +  /* This section of code's only "output" is via assert() statements. */
          124  +  if ( rc==SQLITE_OK ){
          125  +    u64 x = (((u64)1)<<63)-1;
          126  +    double y;
          127  +    assert(sizeof(x)==8);
          128  +    assert(sizeof(x)==sizeof(y));
          129  +    memcpy(&y, &x, 8);
          130  +    assert( sqlite3IsNaN(y) );
          131  +  }
          132  +#endif
          133  +
   120    134     return rc;
   121    135   }
   122    136   
   123    137   /*
   124    138   ** Undo the effects of sqlite3_initialize().  Must not be called while
   125    139   ** there are outstanding database connections or memory allocations or
   126    140   ** while any part of SQLite is otherwise in use in any thread.  This