Skip to content

Conversation

@SamuelMarks
Copy link
Contributor

@SamuelMarks SamuelMarks commented Nov 1, 2020

gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-instr-generate -I./Include/internal -DMODULE_NAME="sqlite3" -DSQLITE_OMIT_LOAD_EXTENSION=1 -IModules/_sqlite -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I./Include -I/opt/python3.9/include -I. -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/include -IPython-3.9.0/Include -IPython-3.9.0 -c Python-3.9.0/Modules/_sqlite/connection.c -o build/temp.macosx-10.15-x86_64-3.9/Python-3.9.0/Modules/_sqlite/connection.o
Python-3.9.0/Modules/_sqlite/connection.c:1066:9: warning: 'sqlite3_trace' is deprecated: first deprecated in macOS 10.12
      [-Wdeprecated-declarations]
        sqlite3_trace(self->db, 0, (void*)0);
        ^~~~~~~~~~~~~
        sqlite3_trace_v2
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h:3022:36: note: 'sqlite3_trace' has
      been explicitly marked deprecated here
SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(
                                   ^
Python-3.9.0/Modules/_sqlite/connection.c:1069:9: warning: 'sqlite3_trace' is deprecated: first deprecated in macOS 10.12
      [-Wdeprecated-declarations]
        sqlite3_trace(self->db, _trace_callback, trace_callback);
        ^~~~~~~~~~~~~
        sqlite3_trace_v2
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h:3022:36: note: 'sqlite3_trace' has
      been explicitly marked deprecated here
SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(
                                   ^
2 warnings generated.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h
#define SQLITE_VERSION        "3.28.0"
#define SQLITE_VERSION_NUMBER 3028000
#define SQLITE_SOURCE_ID      "2019-04-15 14:49:49 378230ae7f4b721c8b8d83c8ceb891449685cd23b1702a57841f1be40b5daapl

https://bugs.python.org/issue42229

@SamuelMarks SamuelMarks changed the title bpo-NNNN: Fix SQLite warnings on macOS bpo-42229: Fix SQLite warnings on macOS Nov 1, 2020
@jstasiak
Copy link
Contributor

jstasiak commented Nov 1, 2020

I wanted to review this (I like removing warnings) but I'm unable to reproduce the warning you mention on Mac OS 10.14.6 with the current master branch (d281005).

Comment on lines +36 to +38
#if SQLITE_VERSION_NUMBER >= 3014000 || \
defined(__APPLE__) && defined(__MACH__) \
&& __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail if you're compiling against SQLite pre 3.14 on macOS. One cannot assume that all macOS builds uses the SQLite 3 that's shipped with the OS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should check in the configure; and set the HAVE_TRACE_V2 there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants