views:

491

answers:

3

I am using the sqlite3.c library.
It compiles with 140 something conversion warnings.
What's wrong with my set-up?

Thanks.

sqlite3.c
c:\Projects\Lib\sqlite3.c(11311) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11312) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11313) : warning C4244: '=' : conversion from 'double' to 'sqlite3_int64', possible loss of data
c:\Projects\Lib\sqlite3.c(11316) : warning C4244: '+=' : conversion from 'double' to 'sqlite3_int64', possible loss of data
c:\Projects\Lib\sqlite3.c(11430) : warning C4244: '=' : conversion from 'sqlite3_int64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11431) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11434) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11435) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11436) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11437) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11452) : warning C4244: '=' : conversion from 'sqlite3_int64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11454) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11499) : warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11505) : warning C4244: '=' : conversion from 'double' to 'time_t', possible loss of data
c:\Projects\Lib\sqlite3.c(11547) : warning C4244: 'return' : conversion from 'sqlite3_int64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11607) : warning C4244: '=' : conversion from 'double' to 'sqlite3_int64', possible loss of data
c:\Projects\Lib\sqlite3.c(11633) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11720) : warning C4244: '+=' : conversion from 'double' to 'sqlite3_int64', possible loss of data
c:\Projects\Lib\sqlite3.c(11722) : warning C4244: '+=' : conversion from 'double' to 'sqlite3_int64', possible loss of data
c:\Projects\Lib\sqlite3.c(11724) : warning C4244: '+=' : conversion from 'double' to 'sqlite3_int64', possible loss of data
c:\Projects\Lib\sqlite3.c(11726) : warning C4244: '+=' : conversion from 'double' to 'sqlite3_int64', possible loss of data
c:\Projects\Lib\sqlite3.c(11730) : warning C4244: '+=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11736) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11738) : warning C4244: '+=' : conversion from 'double' to 'sqlite3_int64', possible loss of data
c:\Projects\Lib\sqlite3.c(11742) : warning C4244: '+=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11781) : warning C4244: '=' : conversion from 'double' to 'sqlite3_int64', possible loss of data
c:\Projects\Lib\sqlite3.c(11950) : warning C4244: 'function' : conversion from 'u64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11981) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(11984) : warning C4244: '=' : conversion from 'sqlite3_int64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(12007) : warning C4244: '=' : conversion from 'sqlite3_int64' to 'char', possible loss of data
c:\Projects\Lib\sqlite3.c(12607) : warning C4244: 'return' : conversion from 'sqlite3_int64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(16030) : warning C4244: '=' : conversion from 'sqlite3_int64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(17184) : warning C4244: 'initializing' : conversion from 'sqlite_uint64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(17512) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(19310) : warning C4244: '=' : conversion from 'u64' to 'unsigned char', possible loss of data
c:\Projects\Lib\sqlite3.c(19313) : warning C4244: '=' : conversion from 'u64' to 'unsigned char', possible loss of data
c:\Projects\Lib\sqlite3.c(19320) : warning C4244: '=' : conversion from 'u64' to 'u8', possible loss of data
c:\Projects\Lib\sqlite3.c(25669) : warning C4244: 'initializing' : conversion from 'sqlite3_int64' to 'LONG', possible loss of data
c:\Projects\Lib\sqlite3.c(25670) : warning C4244: 'initializing' : conversion from 'sqlite3_int64' to 'LONG', possible loss of data
c:\Projects\Lib\sqlite3.c(25702) : warning C4244: 'initializing' : conversion from 'sqlite3_int64' to 'LONG', possible loss of data
c:\Projects\Lib\sqlite3.c(25703) : warning C4244: 'initializing' : conversion from 'sqlite3_int64' to 'LONG', possible loss of data
c:\Projects\Lib\sqlite3.c(25735) : warning C4244: 'initializing' : conversion from 'sqlite3_int64' to 'LONG', possible loss of data
c:\Projects\Lib\sqlite3.c(25736) : warning C4244: 'initializing' : conversion from 'sqlite3_int64' to 'LONG', possible loss of data
c:\Projects\Lib\sqlite3.c(28785) : warning C4018: '>=' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(29505) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(29511) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(29734) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data
c:\Projects\Lib\sqlite3.c(29747) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data
c:\Projects\Lib\sqlite3.c(29871) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data
c:\Projects\Lib\sqlite3.c(29887) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data
c:\Projects\Lib\sqlite3.c(30081) : warning C4018: '>' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(30360) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(30367) : warning C4244: '=' : conversion from 'i64' to 'Pgno', possible loss of data
c:\Projects\Lib\sqlite3.c(30370) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(30665) : warning C4018: '<=' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(31713) : warning C4018: '>' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(31771) : warning C4018: '>' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(31978) : warning C4018: '<=' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(33807) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(33809) : warning C4244: 'function' : conversion from 'i64' to 'u32', possible loss of data
c:\Projects\Lib\sqlite3.c(34527) : warning C4244: '=' : conversion from 'u16' to 'unsigned char', possible loss of data
c:\Projects\Lib\sqlite3.c(34623) : warning C4018: '>' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(35382) : warning C4244: '=' : conversion from 'u16' to 'unsigned char', possible loss of data
c:\Projects\Lib\sqlite3.c(35884) : warning C4018: '<=' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(36557) : warning C4018: '<=' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(36674) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data
c:\Projects\Lib\sqlite3.c(36679) : warning C4018: '>' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(36880) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data
c:\Projects\Lib\sqlite3.c(36887) : warning C4018: '>' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(37265) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(37267) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(37272) : warning C4244: 'function' : conversion from 'i64' to 'u32', possible loss of data
c:\Projects\Lib\sqlite3.c(37273) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(37343) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(37557) : warning C4018: '<=' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(37695) : warning C4018: '>' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(37891) : warning C4018: '>' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(37962) : warning C4244: '+=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(37964) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(38070) : warning C4244: '=' : conversion from 'u16' to 'u8', possible loss of data
c:\Projects\Lib\sqlite3.c(38150) : warning C4244: '=' : conversion from 'u16' to 'u8', possible loss of data
c:\Projects\Lib\sqlite3.c(39686) : warning C4018: '>' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(40231) : warning C4244: '+=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(40541) : warning C4244: '=' : conversion from 'i64' to 'Pgno', possible loss of data
c:\Projects\Lib\sqlite3.c(40590) : warning C4244: 'initializing' : conversion from 'sqlite3_int64' to 'Pgno', possible loss of data
c:\Projects\Lib\sqlite3.c(40671) : warning C4244: 'initializing' : conversion from 'i64' to 'Pgno', possible loss of data
c:\Projects\Lib\sqlite3.c(41144) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(41152) : warning C4244: 'function' : conversion from 'i64' to 'size_t', possible loss of data
c:\Projects\Lib\sqlite3.c(41153) : warning C4244: '+=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(41493) : warning C4244: '+=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(41688) : warning C4244: '=' : conversion from 'const i64' to 'double', possible loss of data
c:\Projects\Lib\sqlite3.c(41693) : warning C4244: '=' : conversion from 'const i64' to 'double', possible loss of data
c:\Projects\Lib\sqlite3.c(42031) : warning C4244: 'return' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(43995) : warning C4244: 'return' : conversion from 'i64' to 'u32', possible loss of data
c:\Projects\Lib\sqlite3.c(44011) : warning C4244: '+=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(44118) : warning C4244: '=' : conversion from 'u64' to 'u8', possible loss of data
c:\Projects\Lib\sqlite3.c(44132) : warning C4244: '+=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(44287) : warning C4018: '<' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(44382) : warning C4018: '>=' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(44444) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(44489) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(44827) : warning C4244: 'return' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(45006) : warning C4244: '=' : conversion from 'double' to 'i64', possible loss of data
c:\Projects\Lib\sqlite3.c(45036) : warning C4244: '=' : conversion from 'double' to 'u64', possible loss of data
c:\Projects\Lib\sqlite3.c(46720) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(46735) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(47061) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(47071) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(47168) : warning C4244: '=' : conversion from 'i64' to 'double', possible loss of data
c:\Projects\Lib\sqlite3.c(47961) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data
c:\Projects\Lib\sqlite3.c(47982) : warning C4018: '>' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(48020) : warning C4018: '>=' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(48038) : warning C4018: '<' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(48055) : warning C4018: '<' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(48235) : warning C4244: '+=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(48258) : warning C4244: 'function' : conversion from 'u64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(48270) : warning C4244: 'function' : conversion from 'u64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(48275) : warning C4244: '=' : conversion from 'u64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(48493) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(48497) : warning C4244: '=' : conversion from 'i64' to 'u8', possible loss of data
c:\Projects\Lib\sqlite3.c(48633) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(49420) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(49564) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data
c:\Projects\Lib\sqlite3.c(49567) : warning C4018: '>' : signed/unsigned mismatch
c:\Projects\Lib\sqlite3.c(50183) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(50189) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(50635) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(50636) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(62675) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(62711) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(63239) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(63512) : warning C4244: 'initializing' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(63513) : warning C4244: 'initializing' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(63514) : warning C4244: 'initializing' : conversion from 'i64' to 'int', possible loss of data
c:\Projects\Lib\sqlite3.c(65536) : warning C4049: compiler limit : terminating line number emission
        Compiler limit for line number is 65535
c:\Projects\Lib\sqlite3.c(77234) : warning C4244: '=' : conversion from 'u16' to 'unsigned char', possible loss of data
+1  A: 

No, it's not your setup. SQLite is written with lots of warnings. They haven't been fixed for years. Not much to do but ignore the warnings or contribute back patches

Robert Gould
+3  A: 

From the SQLite web site:

Some people say that we should eliminate all warnings because benign warnings mask real warnings that might arise in future changes. This is true enough. But in reply, the developers observe that all warnings have already been fixed in the compilers used for SQLite development (various versions of GCC). Compiler warnings only arise from compilers that the developers do not have access to.

http://www.sqlite.org/faq.html#q17

Paul Lefebvre
They don't have access Visual Studio?!?
Marc Bernier
+1  A: 

In Visual Studio 2005 or 2008, it's easy to configure the compiler warning level just on sqlite.c. That way, you can use a nice verbose /w4 on all the code that you write and a /w1 on sqlite3.c so you don't get these warnings. Right-click sqlite.c in the solution explorer, click on Properties, drill down to Configuration Properties -> C/C++ -> General, and select /W1 or /W0 from the Warning Level drop-down.

I haven't tried this approach in other versions of VS or VC++. It would be great if you mentioned your specific compiler/IDE.

Leif Carlsen
+1: This is a very nice tip. I don't understand why no-one else voted this up.
ereOn