1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Give the debugging routine print_pager_stats() external linkage in order to

suppress harmless compiler and TSAN warnings.

FossilOrigin-Name: ff4dc08298ab3988e69fe60802657791f65d2af15f4b1cbd1d02649bc597d0d6
This commit is contained in:
drh
2018-08-30 18:53:09 +00:00
parent e35fc302c3
commit ed9272159e
3 changed files with 12 additions and 15 deletions

View File

@@ -997,8 +997,12 @@ static int assert_pager_state(Pager *p){
** to "print *pPager" in gdb:
**
** (gdb) printf "%s", print_pager_state(pPager)
**
** This routine has external linkage in order to suppress compiler warnings
** about an unused function. It is enclosed within SQLITE_DEBUG and so does
** not appear in normal builds.
*/
static char *print_pager_state(Pager *p){
char *print_pager_state(Pager *p){
static char zRet[1024];
sqlite3_snprintf(1024, zRet,
@@ -7278,13 +7282,6 @@ int sqlite3PagerLockingMode(Pager *pPager, int eMode){
int sqlite3PagerSetJournalMode(Pager *pPager, int eMode){
u8 eOld = pPager->journalMode; /* Prior journalmode */
#ifdef SQLITE_DEBUG
/* The print_pager_state() routine is intended to be used by the debugger
** only. We invoke it once here to suppress a compiler warning. */
print_pager_state(pPager);
#endif
/* The eMode parameter is always valid */
assert( eMode==PAGER_JOURNALMODE_DELETE
|| eMode==PAGER_JOURNALMODE_TRUNCATE