Is the number of size conversion warnings during sqlite compile disconcerting to anyone but myself? I've attached a log of them below. I want to know that when I compile this on a 64 bit system none of my memory pointers get truncated. And visa-versa with the file pointers. If we are using a 32bit index for something like "query size", then I agree that 32bits should be more than sufficient. We should cast it and assert it in debug mode. Hence, if the user does have some strange crash and it ends up being caused because their query string was more than 4GB, they can at least detect that problem in debug mode. With me?
Deleting intermediate files and output files for project 'sqlite', configuration 'Release|Win32'. Compiling... where.c vdbemem.c vdbemem.c(194) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vdbemem.c(319) : warning C4244: '=' : conversion from 'double' to 'i64', possible loss of data vdbemem.c(491) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vdbemem.c(557) : warning C4244: '=' : conversion from 'const i64' to 'double', possible loss of data vdbemem.c(562) : warning C4244: '=' : conversion from 'const i64' to 'double', possible loss of data vdbemem.c(779) : warning C4311: 'type cast' : pointer truncation from 'char *' to 'int' vdbemem.c(859) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vdbefifo.c vdbeaux.c vdbeaux.c(482) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vdbeaux.c(527) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vdbeaux.c(531) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data vdbeaux.c(564) : warning C4018: '<=' : signed/unsigned mismatch vdbeaux.c(659) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vdbeaux.c(676) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vdbeaux.c(862) : warning C4244: 'function' : conversion from '__w64 int' to 'int', possible loss of data vdbeaux.c(1034) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data vdbeaux.c(1595) : warning C4244: 'return' : conversion from 'i64' to 'u32', possible loss of data vdbeaux.c(1651) : warning C4244: '=' : conversion from 'u64' to 'unsigned char', possible loss of data vdbeaux.c(1813) : warning C4018: '>=' : signed/unsigned mismatch vdbeaux.c(1815) : warning C4018: '>=' : signed/unsigned mismatch vdbeaux.c(1841) : warning C4018: '<' : signed/unsigned mismatch vdbeaux.c(1843) : warning C4018: '<' : signed/unsigned mismatch vdbeaux.c(1887) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data vdbeaux.c(1926) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data vdbeapi.c vdbeapi.c(55) : warning C4244: 'return' : conversion from 'i64' to 'int', possible loss of data vdbeapi.c(201) : warning C4244: '=' : conversion from 'double' to 'i64', possible loss of data vdbeapi.c(238) : warning C4244: '=' : conversion from 'double' to 'u64', possible loss of data vdbe.c vdbe.c(662) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vdbe.c(677) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vdbe.c(693) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vdbe.c(752) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vdbe.c(1931) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data vdbe.c(1997) : warning C4018: '>=' : signed/unsigned mismatch vdbe.c(2013) : warning C4018: '<' : signed/unsigned mismatch vdbe.c(2028) : warning C4018: '<' : signed/unsigned mismatch vdbe.c(2450) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data vdbe.c(2454) : warning C4244: '=' : conversion from 'i64' to 'u8', possible loss of data vdbe.c(2554) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data vdbe.c(2572) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data vdbe.c(3445) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data vdbe.c(4118) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data vdbe.c(4131) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data vacuum.c vacuum.c(131) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data util.c util.c(725) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data util.c(757) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data util.c(1042) : warning C4244: 'return' : conversion from '__w64 int' to 'int', possible loss of data util.c(1227) : warning C4244: '=' : conversion from 'u64' to 'unsigned char', possible loss of data util.c(1230) : warning C4244: '=' : conversion from 'u64' to 'unsigned char', possible loss of data util.c(1237) : warning C4244: '=' : conversion from 'u64' to 'u8', possible loss of data util.c(1356) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data utf.c utf.c(336) : warning C4244: '=' : conversion from '__w64 int' to 'int', possible loss of data utf.c(353) : warning C4244: '=' : conversion from '__w64 int' to 'int', possible loss of data utf.c(501) : warning C4244: 'return' : conversion from '__w64 int' to 'int', possible loss of data utf.c(549) : warning C4244: 'function' : conversion from '__w64 int' to 'int', possible loss of data update.c trigger.c trigger.c(113) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data trigger.c(260) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data trigger.c(265) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data trigger.c(454) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data trigger.c(476) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data trigger.c(540) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data trigger.c(631) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data tokenize.c tclsqlite.c table.c table.c(149) : warning C4312: 'type cast' : conversion from 'int' to 'char *' of greater size table.c(194) : warning C4311: 'type cast' : pointer truncation from 'char *' to 'int' shell.c shell.c(387) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data shell.c(407) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data shell.c(409) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data shell.c(586) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data shell.c(587) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data shell.c(738) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data shell.c(880) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data shell.c(1035) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data shell.c(1042) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data shell.c(1056) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data shell.c(1148) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data shell.c(1353) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data shell.c(1472) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data shell.c(1481) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data shell.c(1702) : warning C4013: 'access' undefined; assuming extern returning int select.c select.c(183) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data select.c(977) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data select.c(1005) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data random.c printf.c printf.c(413) : warning C4244: '=' : conversion from '__w64 int' to 'int', possible loss of data printf.c(426) : warning C4244: '=' : conversion from '__w64 int' to 'int', possible loss of data printf.c(551) : warning C4244: '=' : conversion from '__w64 int' to 'int', possible loss of data printf.c(596) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data printf.c(644) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data printf.c(647) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data prepare.c prepare.c(577) : warning C4244: 'function' : conversion from '__w64 int' to 'int', possible loss of data pragma.c pragma.c(49) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data Generating Code... Compiling... parse.c parse.y(154) : warning C4244: '=' : conversion from '__w64 unsigned int' to 'unsigned int', possible loss of data parse.y(229) : warning C4244: '=' : conversion from '__w64 int' to 'unsigned int', possible loss of data parse.y(233) : warning C4244: '=' : conversion from '__w64 int' to 'unsigned int', possible loss of data parse.y(919) : warning C4244: '=' : conversion from '__w64 unsigned int' to 'unsigned int', possible loss of data pager.c pager.c(566) : warning C4018: '<' : signed/unsigned mismatch pager.c(762) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data pager.c(1097) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data pager.c(1102) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data pager.c(1312) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data pager.c(1330) : warning C4018: '<' : signed/unsigned mismatch pager.c(1446) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data pager.c(1463) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data pager.c(1640) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data pager.c(1822) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data pager.c(1828) : warning C4244: 'return' : conversion from 'i64' to 'int', possible loss of data pager.c(1926) : warning C4018: '<=' : signed/unsigned mismatch pager.c(2305) : warning C4018: '<=' : signed/unsigned mismatch pager.c(3688) : warning C4018: '<=' : signed/unsigned mismatch os_win.c os_win.c(781) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data os_win.c(785) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data os_win.c(873) : warning C4244: 'initializing' : conversion from 'i64' to 'LONG', possible loss of data os_win.c(874) : warning C4244: 'initializing' : conversion from 'i64' to 'LONG', possible loss of data os_win.c(915) : warning C4244: 'initializing' : conversion from 'i64' to 'LONG', possible loss of data os_win.c(919) : warning C4244: 'function' : conversion from 'i64' to 'LONG', possible loss of data os_win.c(1255) : warning C4311: 'type cast' : pointer truncation from 'HANDLE' to 'int' os_unix.c os.c opcodes.c main.c main.c(413) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data main.c(773) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data main.c(783) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data legacy.c insert.c insert.c(993) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data insert.c(996) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data hash.c hash.c(105) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data func.c func.c(859) : warning C4244: 'initializing' : conversion from 'i64' to 'int', possible loss of data func.c(860) : warning C4244: 'initializing' : conversion from 'i64' to 'int', possible loss of data func.c(861) : warning C4244: 'initializing' : conversion from 'i64' to 'int', possible loss of data func.c(1045) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data func.c(1067) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data func.c(1089) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data expr.c experimental.c delete.c date.c date.c(233) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(234) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(339) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(340) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(343) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(344) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(345) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(346) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(360) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(361) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(363) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(407) : warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data date.c(413) : warning C4244: '=' : conversion from 'double' to 'time_t', possible loss of data date.c(508) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(514) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(590) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data date.c(606) : warning C4244: '+=' : conversion from 'double' to 'int', possible loss of data date.c(612) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(618) : warning C4244: '+=' : conversion from 'double' to 'int', possible loss of data date.c(812) : warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data date.c(813) : warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data date.c(815) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data date.c(827) : warning C4244: '=' : conversion from 'double' to 'int', possible loss of data date.c(839) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data date.c(844) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data date.c(849) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data complete.c callback.c callback.c(28) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data callback.c(59) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data callback.c(160) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data build.c build.c(183) : warning C4244: 'function' : conversion from '__w64 int' to 'int', possible loss of data build.c(262) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data build.c(320) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data build.c(347) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data build.c(363) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data build.c(552) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data build.c(556) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data build.c(620) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data build.c(1216) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data build.c(1302) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data build.c(1319) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data build.c(1324) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data build.c(1330) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data build.c(1481) : warning C4244: '=' : conversion from '__w64 int' to 'int', possible loss of data build.c(1531) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data build.c(1538) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data build.c(1555) : warning C4244: '=' : conversion from '__w64 int' to 'int', possible loss of data build.c(1624) : warning C4244: '=' : conversion from '__w64 int' to 'int', possible loss of data build.c(2036) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data build.c(2073) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data build.c(2342) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data build.c(2354) : warning C4267: '+=' : conversion from 'size_t' to 'int', possible loss of data build.c(2361) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data build.c(2490) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data btree.c btree.c(538) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data btree.c(540) : warning C4244: 'function' : conversion from 'i64' to 'u32', possible loss of data btree.c(2402) : warning C4018: '>' : signed/unsigned mismatch btree.c(2402) : warning C4018: '<=' : signed/unsigned mismatch btree.c(2990) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data btree.c(2996) : warning C4018: '>' : signed/unsigned mismatch btree.c(3129) : warning C4244: '=' : conversion from 'i64' to 'u32', possible loss of data btree.c(3136) : warning C4018: '>' : signed/unsigned mismatch btree.c(3448) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data btree.c(3448) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data btree.c(3450) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data btree.c(3452) : warning C4244: 'function' : conversion from 'i64' to 'u32', possible loss of data btree.c(3453) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data btree.c(3453) : warning C4244: 'function' : conversion from 'i64' to 'int', possible loss of data btree.c(3817) : warning C4018: '>' : signed/unsigned mismatch btree.c(3970) : warning C4018: '>' : signed/unsigned mismatch btree.c(4038) : warning C4244: '+=' : conversion from 'i64' to 'int', possible loss of data btree.c(4040) : warning C4244: '=' : conversion from 'i64' to 'int', possible loss of data btree.c(5591) : warning C4018: '>' : signed/unsigned mismatch btree.c(6281) : warning C4244: '+=' : conversion from 'i64' to 'int', possible loss of data auth.c Generating Code... Compiling... attach.c attach.c(314) : warning C4267: 'function' : conversion from 'size_t' to 'int', possible loss of data analyze.c alter.c Generating Code... Creating library... sqlite - 0 error(s), 199 warning(s) ______________________________ Brannon King ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯