Warnings when compiling code with nmake on Windows (x64)
От | Michael Paquier |
---|---|
Тема | Warnings when compiling code with nmake on Windows (x64) |
Дата | |
Msg-id | CAB7nPqQAbnmB9WmqzF22HTSkW5rRZaPLuOQ9LGfKFYw=-7JAMw@mail.gmail.com обсуждение исходный текст |
Список | pgsql-odbc |
Hi all, When compiling the code using nmake on Windows, I am seeing a bunch of warnings: connection.c(3211) : warning C4267: 'function' : conversion from 'size_t' to 'in t', possible loss of data connection.c(3241) : warning C4267: 'function' : conversion from 'size_t' to 'in t', possible loss of data convert.c convert.c(1180) : warning C4244: 'function' : conversion from 'SQLLEN' to 'int', possible loss of data convert.c(3186) : warning C4244: '=' : conversion from '__int64' to 'int', possi ble loss of data convert.c(3233) : warning C4244: '=' : conversion from '__int64' to 'int', possi ble loss of data convert.c(3244) : warning C4244: '=' : conversion from '__int64' to 'int', possi ble loss of data convert.c(3253) : warning C4244: '=' : conversion from '__int64' to 'int', possi ble loss of data convert.c(3690) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int ', possible loss of data convert.c(4055) : warning C4267: '=' : conversion from 'size_t' to 'int', possib le loss of data convert.c(4067) : warning C4267: '=' : conversion from 'size_t' to 'int', possib le loss of data convert.c(4163) : warning C4267: '=' : conversion from 'size_t' to 'int', possib le loss of data info.c(1504) : warning C4267: '=' : conversion from 'size_t' to 'SQLSMALLINT', p ossible loss of data parse.c(144) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data parse.c(1342) : warning C4244: '=' : conversion from '__int64' to 'int', possibl e loss of data parse.c(1361) : warning C4244: '=' : conversion from '__int64' to 'int', possibl e loss of data pgtypes.c pgtypes.c(1493) : warning C4267: '=' : conversion from 'size_t' to 'int', possib le loss of data Generating Code... c:\users\mpaquier\git\pgodbc\convert.c(692) : warning C4723: potential divide by 0 setup.c(393) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data setup.c(490) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data socket.c statement.c statement.c(1045) : warning C4244: '=' : conversion from '__int64' to 'int', pos sible loss of data statement.c(2869) : warning C4267: '=' : conversion from 'size_t' to 'int', poss ible loss of data The attached patch is a tentative to fix them, except the division by 0 in convert.c I was not really sure how to fix the division by 0 case... This work has been done on a Win7 box using Visual 10 and SDK 7.1. Most of those warnings are caused by difference of 64b pointers with results casted back to int4. Comments welcome. -- Michael
Вложения
В списке pgsql-odbc по дате отправления: