SQLite Forum

Bug: MSVC uses intrinsic versions of ceil and floor for floating-point modes precise and fast (diagnosed)
Login
I'm trying to compile the nightly build (2020-12-30) on Win10 using Visual Studio 2017, with `SQLITE_ENABLE_MATH_FUNCTIONS` defined. I run into three errors:

```
>sqlite3.c(119997): error C2099: initializer is not a constant
>sqlite3.c(119997): warning C4047: 'initializing': 'FuncDef *' differs in levels of indirection from 'void (__cdecl *)(sqlite3_context *,int,sqlite3_value **)'
>sqlite3.c(119997): warning C4047: 'initializing': 'void (__cdecl *)(sqlite3_context *,int,sqlite3_value **)' differs in levels of indirection from 'char [5]'
>sqlite3.c(119998): error C2099: initializer is not a constant
>sqlite3.c(119998): warning C4047: 'initializing': 'FuncDef *' differs in levels of indirection from 'void (__cdecl *)(sqlite3_context *,int,sqlite3_value **)'
>sqlite3.c(119998): warning C4047: 'initializing': 'void (__cdecl *)(sqlite3_context *,int,sqlite3_value **)' differs in levels of indirection from 'char [8]'
>sqlite3.c(119999): error C2099: initializer is not a constant
>sqlite3.c(119999): warning C4047: 'initializing': 'FuncDef *' differs in levels of indirection from 'void (__cdecl *)(sqlite3_context *,int,sqlite3_value **)'
>sqlite3.c(119999): warning C4047: 'initializing': 'void (__cdecl *)(sqlite3_context *,int,sqlite3_value **)' differs in levels of indirection from 'char [6]'
```

Lines 119996 to 119999 is:

```
#ifdef SQLITE_ENABLE_MATH_FUNCTIONS
    MFUNCTION(ceil,              1, ceil,      ceilingFunc ),
    MFUNCTION(ceiling,           1, ceil,      ceilingFunc ),
    MFUNCTION(floor,             1, floor,     ceilingFunc ),
```

Any pointers to what's wrong here? My background is Linux/macOS, so I'm on thin ice with Visual Studio and Windows. (BTW, VS 2017 is a requirement, which is why I'm not using the most recent VS version.)