Skip to content

Commit 6463a91

Browse files
committed
Eliminated warnings on OS/X
Two 64-bit warnings. Also turned off the ODBC deprecation warnings. Apparently Apple has decided not to maintain iODBC for OS/X in the future. ODBC can still be used, but iODBC will have to be installed separately.
1 parent 9423193 commit 6463a91

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎setup.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ def get_compiler_settings(version_str):
147147
# OS/X now ships with iODBC.
148148
settings['libraries'].append('iodbc')
149149

150+
# Apple has decided they won't maintain the iODBC system in OS/X and has added deprecation warnings in 10.8.
151+
# For now target 10.7 to eliminate the warnings.
152+
153+
# Python functions take a lot of 'char *' that really should be const. gcc complains about this *a lot*
154+
settings['extra_compile_args'] = ['-Wno-write-strings', '-Wno-deprecated-declarations']
155+
156+
settings['define_macros'].append( ('MAC_OS_X_VERSION_10_7',) )
157+
150158
else:
151159
# Other posix-like: Linux, Solaris, etc.
152160

‎src/getdata.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class DataBuffer
257257
I(bufferOwner == 0);
258258
PyObject* result = PyUnicode_FromSQLWCHAR((const SQLWCHAR*)buffer, bytesUsed / element_size);
259259
if (result == 0)
260-
return false;
260+
return 0;
261261
pyodbc_free(buffer);
262262
buffer = 0;
263263
return result;

‎src/params.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static char* CreateDecimalString(long sign, PyObject* digits, long exp)
343343
long count = (long)PyTuple_GET_SIZE(digits);
344344

345345
char* pch;
346-
int len;
346+
long len;
347347

348348
if (exp >= 0)
349349
{

0 commit comments

Comments
 (0)