summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-08-31 01:22:51 +0200
committerSergei Golubchik <serg@mariadb.org>2018-09-04 09:19:48 +0200
commit8bee7c16c879d254bf87e0439e5fce19c0680e8f (patch)
tree50d37ff20fa57d46c6e43be2fa511b6ff4203437
parentaec54fb9382f70c796da27be31f25ce3aa5aa176 (diff)
downloadmariadb-git-8bee7c16c879d254bf87e0439e5fce19c0680e8f.tar.gz
compiler warnings (clang 4.0.1 on i386)
extra/mariabackup/fil_cur.cc:361:42: warning: format specifies type 'unsigned long' but the argument has type 'ib_int64_t' (aka 'long long') [-Wformat] extra/mariabackup/fil_cur.cc:376:9: warning: format specifies type 'unsigned long' but the argument has type 'ib_int64_t' (aka 'long long') [-Wformat] sql/handler.cc:6196:45: warning: format specifies type 'unsigned long' but the argument has type 'wsrep_trx_id_t' (aka 'unsigned long long') [-Wformat] sql/log.cc:1681:16: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat] sql/log.cc:1687:16: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat] sql/wsrep_sst.cc:1388:86: warning: format specifies type 'long' but the argument has type 'wsrep_seqno_t' (aka 'long long') [-Wformat] sql/wsrep_sst.cc:232:86: warning: format specifies type 'long' but the argument has type 'wsrep_seqno_t' (aka 'long long') [-Wformat] storage/connect/filamdbf.cpp:450:47: warning: format specifies type 'short' but the argument has type 'int' [-Wformat] storage/connect/filamdbf.cpp:970:47: warning: format specifies type 'short' but the argument has type 'int' [-Wformat] storage/connect/inihandl.cpp:197:16: warning: address of array 'key->name' will always evaluate to 'true' [-Wpointer-bool-conversion] storage/innobase/btr/btr0scrub.cc:151:17: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/innobase/buf/buf0buf.cc:5085:8: warning: nonnull parameter 'bpage' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion] storage/innobase/fil/fil0crypt.cc:2454:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/innobase/handler/ha_innodb.cc:18685:7: warning: format specifies type 'unsigned long' but the argument has type 'wsrep_trx_id_t' (aka 'unsigned long long') [-Wformat] storage/innobase/row/row0mysql.cc:3319:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/innobase/row/row0mysql.cc:3327:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/maria/ma_norec.c:35:10: warning: implicit conversion from 'int' to 'my_bool' (aka 'char') changes value from 131 to -125 [-Wconstant-conversion] storage/maria/ma_norec.c:42:10: warning: implicit conversion from 'int' to 'my_bool' (aka 'char') changes value from 131 to -125 [-Wconstant-conversion] storage/maria/ma_test2.c:1009:12: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat] storage/maria/ma_test2.c:1010:12: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat] storage/mroonga/ha_mroonga.cpp:9189:44: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] storage/mroonga/vendor/groonga/lib/expr.c:4987:22: warning: comparison of constant -1 with expression of type 'grn_operator' is always false [-Wtautological-constant-out-of-range-compare] storage/xtradb/btr/btr0scrub.cc:151:17: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/xtradb/buf/buf0buf.cc:5047:8: warning: nonnull parameter 'bpage' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion] storage/xtradb/fil/fil0crypt.cc:2454:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/xtradb/row/row0mysql.cc:3324:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/xtradb/row/row0mysql.cc:3332:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] unittest/sql/mf_iocache-t.cc:120:35: warning: format specifies type 'unsigned long' but the argument has type 'int' [-Wformat] unittest/sql/mf_iocache-t.cc:96:35: note: expanded from macro 'INFO_TAIL'
-rw-r--r--config.h.cmake6
-rw-r--r--extra/mariabackup/fil_cur.cc4
-rw-r--r--sql/handler.cc3
-rw-r--r--sql/log.cc4
-rw-r--r--sql/wsrep_sst.cc5
-rw-r--r--storage/connect/filamdbf.cpp4
-rw-r--r--[-rwxr-xr-x]storage/connect/filamvct.cpp0
-rw-r--r--storage/connect/inihandl.cpp2
-rw-r--r--[-rwxr-xr-x]storage/connect/xindex.cpp0
-rw-r--r--storage/innobase/btr/btr0scrub.cc2
-rw-r--r--storage/innobase/buf/buf0buf.cc2
-rw-r--r--storage/innobase/fil/fil0crypt.cc2
-rw-r--r--storage/innobase/handler/ha_innodb.cc2
-rw-r--r--storage/innobase/include/univ.i3
-rw-r--r--storage/innobase/row/row0mysql.cc4
-rw-r--r--storage/maria/ma_norec.c4
-rw-r--r--storage/maria/ma_test2.c4
-rw-r--r--storage/mroonga/ha_mroonga.cpp2
-rw-r--r--storage/mroonga/vendor/groonga/lib/expr.c2
-rw-r--r--storage/xtradb/btr/btr0scrub.cc2
-rw-r--r--storage/xtradb/buf/buf0buf.cc2
-rw-r--r--storage/xtradb/fil/fil0crypt.cc2
-rw-r--r--storage/xtradb/include/univ.i3
-rw-r--r--storage/xtradb/row/row0mysql.cc4
-rw-r--r--unittest/sql/mf_iocache-t.cc4
25 files changed, 35 insertions, 37 deletions
diff --git a/config.h.cmake b/config.h.cmake
index b1a9d813767..52d837fad2a 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -666,12 +666,6 @@
#cmakedefine WSREP_PROC_INFO 1
#endif
-#ifdef _AIX
-/*
- AIX includes inttypes.h from sys/types.h
- Explicitly request format macros before the first inclusion of inttypes.h
-*/
#define __STDC_FORMAT_MACROS
-#endif
#endif
diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc
index 54700ce6837..be4a625342b 100644
--- a/extra/mariabackup/fil_cur.cc
+++ b/extra/mariabackup/fil_cur.cc
@@ -357,7 +357,7 @@ read_retry:
/* skip doublewrite buffer pages */
xb_a(cursor->page_size == UNIV_PAGE_SIZE);
msg("[%02u] mariabackup: "
- "Page %lu is a doublewrite buffer page, "
+ "Page " UINT64PF " is a doublewrite buffer page, "
"skipping.\n", cursor->thread_n, page_no);
} else {
retry_count--;
@@ -372,7 +372,7 @@ read_retry:
}
msg("[%02u] mariabackup: "
"Database page corruption detected at page "
- "%lu, retrying...\n", cursor->thread_n,
+ UINT64PF ", retrying...\n", cursor->thread_n,
page_no);
os_thread_sleep(100000);
diff --git a/sql/handler.cc b/sql/handler.cc
index 9c319b995da..dbe3c5a7a67 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -21,6 +21,7 @@
*/
#include <my_global.h>
+#include <inttypes.h>
#include "sql_priv.h"
#include "unireg.h"
#include "rpl_handler.h"
@@ -6168,7 +6169,7 @@ void ha_fake_trx_id(THD *thd)
if (thd->wsrep_ws_handle.trx_id != WSREP_UNDEFINED_TRX_ID)
{
- WSREP_DEBUG("fake trx id skipped: %lu", thd->wsrep_ws_handle.trx_id);
+ WSREP_DEBUG("fake trx id skipped: %" PRIu64, thd->wsrep_ws_handle.trx_id);
DBUG_VOID_RETURN;
}
diff --git a/sql/log.cc b/sql/log.cc
index a95fa0fec03..767070799a9 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1677,13 +1677,13 @@ static int binlog_close_connection(handlerton *hton, THD *thd)
uchar *buf;
size_t len=0;
wsrep_write_cache_buf(cache, &buf, &len);
- WSREP_WARN("binlog trx cache not empty (%lu bytes) @ connection close %lu",
+ WSREP_WARN("binlog trx cache not empty (%zu bytes) @ connection close %lu",
len, thd->thread_id);
if (len > 0) wsrep_dump_rbr_buf(thd, buf, len);
cache = cache_mngr->get_binlog_cache_log(false);
wsrep_write_cache_buf(cache, &buf, &len);
- WSREP_WARN("binlog stmt cache not empty (%lu bytes) @ connection close %lu",
+ WSREP_WARN("binlog stmt cache not empty (%zu bytes) @ connection close %lu",
len, thd->thread_id);
if (len > 0) wsrep_dump_rbr_buf(thd, buf, len);
}
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc
index 0274a364bc5..2af2bfa1822 100644
--- a/sql/wsrep_sst.cc
+++ b/sql/wsrep_sst.cc
@@ -15,6 +15,7 @@
#include "wsrep_sst.h"
+#include <inttypes.h>
#include <mysqld.h>
#include <m_ctype.h>
#include <my_sys.h>
@@ -229,7 +230,7 @@ bool wsrep_sst_wait ()
if (!sst_complete)
{
total_wtime += difftime(end_time, start_time);
- WSREP_DEBUG("Waiting for SST to complete. current seqno: %ld waited %f secs.", local_seqno, total_wtime);
+ WSREP_DEBUG("Waiting for SST to complete. current seqno: %" PRId64 " waited %f secs.", local_seqno, total_wtime);
service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL,
"WSREP state transfer ongoing, current seqno: %ld waited %f secs", local_seqno, total_wtime);
}
@@ -1385,7 +1386,7 @@ void wsrep_SE_init_wait()
if (!SE_initialized)
{
total_wtime += difftime(end_time, start_time);
- WSREP_DEBUG("Waiting for SST to complete. current seqno: %ld waited %f secs.", local_seqno, total_wtime);
+ WSREP_DEBUG("Waiting for SST to complete. current seqno: %" PRId64 " waited %f secs.", local_seqno, total_wtime);
service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL,
"WSREP state transfer ongoing, current seqno: %ld waited %f secs", local_seqno, total_wtime);
}
diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp
index 893e3da0d46..c8bab2b53a4 100644
--- a/storage/connect/filamdbf.cpp
+++ b/storage/connect/filamdbf.cpp
@@ -447,7 +447,7 @@ int DBFFAM::Cardinality(PGLOBAL g)
if (rln && Lrecl != rln) {
// This happens always on some Linux platforms
- sprintf(g->Message, MSG(BAD_LRECL), Lrecl, rln);
+ sprintf(g->Message, MSG(BAD_LRECL), Lrecl, (ushort)rln);
if (Accept) {
Lrecl = rln;
@@ -967,7 +967,7 @@ int DBMFAM::Cardinality(PGLOBAL g)
if (rln && Lrecl != rln) {
// This happens always on some Linux platforms
- sprintf(g->Message, MSG(BAD_LRECL), Lrecl, rln);
+ sprintf(g->Message, MSG(BAD_LRECL), Lrecl, (ushort)rln);
if (Accept) {
Lrecl = rln;
diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp
index dd827d084fa..dd827d084fa 100755..100644
--- a/storage/connect/filamvct.cpp
+++ b/storage/connect/filamvct.cpp
diff --git a/storage/connect/inihandl.cpp b/storage/connect/inihandl.cpp
index c039a980bcb..8a911cb05c0 100644
--- a/storage/connect/inihandl.cpp
+++ b/storage/connect/inihandl.cpp
@@ -194,7 +194,7 @@ static void PROFILE_Save( FILE *file, PROFILESECTION *section )
}
for (key = section->key; key; key = key->next)
- if (key->name && key->name[0]) {
+ if (key->name[0]) {
fprintf(file, "%s", SVP(key->name));
if (key->value)
diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp
index efefc17b5f5..efefc17b5f5 100755..100644
--- a/storage/connect/xindex.cpp
+++ b/storage/connect/xindex.cpp
diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc
index 1b10b79838d..2e667e64d0b 100644
--- a/storage/innobase/btr/btr0scrub.cc
+++ b/storage/innobase/btr/btr0scrub.cc
@@ -145,7 +145,7 @@ btr_scrub_lock_dict_func(ulint space_id, bool lock_to_close_table,
time_t now = time(0);
if (now >= last + 30) {
fprintf(stderr,
- "WARNING: %s:%u waited %ld seconds for"
+ "WARNING: %s:%u waited " TIMETPF " seconds for"
" dict_sys lock, space: %lu"
" lock_to_close_table: %d\n",
file, line, now - start, space_id,
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index c19f2389515..c628147fce5 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -5082,7 +5082,7 @@ database_corrupted:
&& fil_page_get_type(frame) == FIL_PAGE_INDEX
&& page_is_leaf(frame)) {
- if (bpage && bpage->encrypted) {
+ if (bpage->encrypted) {
ib_logf(IB_LOG_LEVEL_WARN,
"Table in tablespace " ULINTPF " encrypted."
"However key management plugin or used key_version %u is not found or"
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 932d7b9e312..7859fe67d40 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -2449,7 +2449,7 @@ fil_space_crypt_close_tablespace(
if (now >= last + 30) {
ib_logf(IB_LOG_LEVEL_WARN,
- "Waited %ld seconds to drop space: %s (" ULINTPF
+ "Waited " TIMETPF " seconds to drop space: %s (" ULINTPF
") active threads %u flushing=%d.",
now - start, space->name, space->id, cnt, flushing);
last = now;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index d2701ecfc0b..58ffd15cd96 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -18648,7 +18648,7 @@ wsrep_innobase_kill_one_trx(
thd_get_thread_id(thd),
victim_trx->id);
- WSREP_DEBUG("Aborting query: %s conf %d trx: %lu",
+ WSREP_DEBUG("Aborting query: %s conf %d trx: %" PRId64,
(thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void",
wsrep_thd_conflict_state(thd, FALSE),
wsrep_thd_ws_handle(thd)->trx_id);
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index dc1dd9db5d1..e4503672375 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -128,7 +128,6 @@ Sun Studio */
#endif /* #if (defined(WIN32) || ... */
#ifndef __WIN__
-#define __STDC_FORMAT_MACROS /* Enable C99 printf format macros */
#include <inttypes.h>
#endif /* !__WIN__ */
@@ -455,6 +454,7 @@ macro ULINTPF. */
# define INT64PF "%lld"
# define UINT64PF "%llu"
# define UINT64PFx "%016llx"
+# define TIMETPF "%ld"
typedef __int64 ib_int64_t;
typedef unsigned __int64 ib_uint64_t;
typedef unsigned __int32 ib_uint32_t;
@@ -464,6 +464,7 @@ typedef unsigned __int32 ib_uint32_t;
# define INT64PF "%" PRId64
# define UINT64PF "%" PRIu64
# define UINT64PFx "%016" PRIx64
+# define TIMETPF "%" PRIdFAST32
typedef int64_t ib_int64_t;
typedef uint64_t ib_uint64_t;
typedef uint32_t ib_uint32_t;
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index abee3386039..c439f550d3b 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -3314,7 +3314,7 @@ fil_wait_crypt_bg_threads(
time_t now = time(0);
if (now >= last + 30) {
fprintf(stderr,
- "WARNING: waited %ld seconds "
+ "WARNING: waited " TIMETPF " seconds "
"for ref-count on table: %s space: %u\n",
now - start, table->name, table->space);
last = now;
@@ -3322,7 +3322,7 @@ fil_wait_crypt_bg_threads(
if (now >= start + 300) {
fprintf(stderr,
- "WARNING: after %ld seconds, gave up waiting "
+ "WARNING: after " TIMETPF " seconds, gave up waiting "
"for ref-count on table: %s space: %u\n",
now - start, table->name, table->space);
break;
diff --git a/storage/maria/ma_norec.c b/storage/maria/ma_norec.c
index 8ed0ef68eb4..f490ab333a5 100644
--- a/storage/maria/ma_norec.c
+++ b/storage/maria/ma_norec.c
@@ -32,14 +32,14 @@ my_bool _ma_update_no_record(MARIA_HA *info __attribute__((unused)),
const uchar *oldrec __attribute__((unused)),
const uchar *record __attribute__((unused)))
{
- return HA_ERR_WRONG_COMMAND;
+ return 1;
}
my_bool _ma_delete_no_record(MARIA_HA *info __attribute__((unused)),
const uchar *record __attribute__((unused)))
{
- return HA_ERR_WRONG_COMMAND;
+ return 1;
}
diff --git a/storage/maria/ma_test2.c b/storage/maria/ma_test2.c
index 6dfa04a5217..24c48c67210 100644
--- a/storage/maria/ma_test2.c
+++ b/storage/maria/ma_test2.c
@@ -1006,8 +1006,8 @@ w_requests: %10lu\n\
writes: %10lu\n\
r_requests: %10lu\n\
reads: %10lu\n",
- maria_pagecache->blocks_used,
- maria_pagecache->global_blocks_changed,
+ (ulong) maria_pagecache->blocks_used,
+ (ulong) maria_pagecache->global_blocks_changed,
(ulong) maria_pagecache->global_cache_w_requests,
(ulong) maria_pagecache->global_cache_write,
(ulong) maria_pagecache->global_cache_r_requests,
diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp
index 96f506f9e36..cbf902b7c0e 100644
--- a/storage/mroonga/ha_mroonga.cpp
+++ b/storage/mroonga/ha_mroonga.cpp
@@ -9186,7 +9186,7 @@ void ha_mroonga::remove_related_files(const char *base_path)
if (stat(entry->d_name, &file_status) != 0) {
continue;
}
- if (!((file_status.st_mode & S_IFMT) && S_IFREG)) {
+ if (!((file_status.st_mode & S_IFMT) == S_IFREG)) {
continue;
}
if (strncmp(entry->d_name, base_path, base_path_length) == 0) {
diff --git a/storage/mroonga/vendor/groonga/lib/expr.c b/storage/mroonga/vendor/groonga/lib/expr.c
index 515dbe068d7..5b1d01678b0 100644
--- a/storage/mroonga/vendor/groonga/lib/expr.c
+++ b/storage/mroonga/vendor/groonga/lib/expr.c
@@ -4984,7 +4984,7 @@ grn_scan_info_build_full(grn_ctx *ctx, grn_obj *expr, int *n,
next_code_op = -1;
for (i = 0, stat = SCAN_START, c = e->codes, ce = &e->codes[e->codes_curr]; c < ce; c++) {
grn_operator code_op;
- if (next_code_op == -1) {
+ if (next_code_op == (grn_operator)-1) {
code_op = c->op;
} else {
code_op = next_code_op;
diff --git a/storage/xtradb/btr/btr0scrub.cc b/storage/xtradb/btr/btr0scrub.cc
index 1b10b79838d..2e667e64d0b 100644
--- a/storage/xtradb/btr/btr0scrub.cc
+++ b/storage/xtradb/btr/btr0scrub.cc
@@ -145,7 +145,7 @@ btr_scrub_lock_dict_func(ulint space_id, bool lock_to_close_table,
time_t now = time(0);
if (now >= last + 30) {
fprintf(stderr,
- "WARNING: %s:%u waited %ld seconds for"
+ "WARNING: %s:%u waited " TIMETPF " seconds for"
" dict_sys lock, space: %lu"
" lock_to_close_table: %d\n",
file, line, now - start, space_id,
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc
index 8178692cd60..d4a6d669bf9 100644
--- a/storage/xtradb/buf/buf0buf.cc
+++ b/storage/xtradb/buf/buf0buf.cc
@@ -5044,7 +5044,7 @@ database_corrupted:
&& fil_page_get_type(frame) == FIL_PAGE_INDEX
&& page_is_leaf(frame)) {
- if (bpage && bpage->encrypted) {
+ if (bpage->encrypted) {
ib_logf(IB_LOG_LEVEL_WARN,
"Table in tablespace " ULINTPF " encrypted."
"However key management plugin or used "
diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc
index 932d7b9e312..7859fe67d40 100644
--- a/storage/xtradb/fil/fil0crypt.cc
+++ b/storage/xtradb/fil/fil0crypt.cc
@@ -2449,7 +2449,7 @@ fil_space_crypt_close_tablespace(
if (now >= last + 30) {
ib_logf(IB_LOG_LEVEL_WARN,
- "Waited %ld seconds to drop space: %s (" ULINTPF
+ "Waited " TIMETPF " seconds to drop space: %s (" ULINTPF
") active threads %u flushing=%d.",
now - start, space->name, space->id, cnt, flushing);
last = now;
diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i
index 7e1a6b0eeac..9aafb88522f 100644
--- a/storage/xtradb/include/univ.i
+++ b/storage/xtradb/include/univ.i
@@ -140,7 +140,6 @@ Sun Studio */
#endif /* #if (defined(WIN32) || ... */
#ifndef __WIN__
-#define __STDC_FORMAT_MACROS /* Enable C99 printf format macros */
#include <inttypes.h>
#endif /* !__WIN__ */
@@ -472,6 +471,7 @@ macro ULINTPF. */
# define INT64PF "%lld"
# define UINT64PF "%llu"
# define UINT64PFx "%016llx"
+# define TIMETPF "%ld"
typedef __int64 ib_int64_t;
typedef unsigned __int64 ib_uint64_t;
typedef unsigned __int32 ib_uint32_t;
@@ -481,6 +481,7 @@ typedef unsigned __int32 ib_uint32_t;
# define INT64PF "%" PRId64
# define UINT64PF "%" PRIu64
# define UINT64PFx "%016" PRIx64
+# define TIMETPF "%" PRIdFAST32
typedef int64_t ib_int64_t;
typedef uint64_t ib_uint64_t;
typedef uint32_t ib_uint32_t;
diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc
index e4a6cd39699..804d55af965 100644
--- a/storage/xtradb/row/row0mysql.cc
+++ b/storage/xtradb/row/row0mysql.cc
@@ -3319,7 +3319,7 @@ fil_wait_crypt_bg_threads(
time_t now = time(0);
if (now >= last + 30) {
fprintf(stderr,
- "WARNING: waited %ld seconds "
+ "WARNING: waited " TIMETPF " seconds "
"for ref-count on table: %s space: %u\n",
now - start, table->name, table->space);
last = now;
@@ -3327,7 +3327,7 @@ fil_wait_crypt_bg_threads(
if (now >= start + 300) {
fprintf(stderr,
- "WARNING: after %ld seconds, gave up waiting "
+ "WARNING: after " TIMETPF " seconds, gave up waiting "
"for ref-count on table: %s space: %u\n",
now - start, table->name, table->space);
break;
diff --git a/unittest/sql/mf_iocache-t.cc b/unittest/sql/mf_iocache-t.cc
index 2cd5b678700..8f97745f0fc 100644
--- a/unittest/sql/mf_iocache-t.cc
+++ b/unittest/sql/mf_iocache-t.cc
@@ -92,8 +92,8 @@ void sql_print_error(const char *format, ...)
IO_CACHE info;
#define CACHE_SIZE 16384
-#define INFO_TAIL ", pos_in_file = %llu, pos_in_mem = %lu", \
- info.pos_in_file, (*info.current_pos - info.request_pos)
+#define INFO_TAIL ", pos_in_file = %llu, pos_in_mem = %td", \
+ info.pos_in_file, *info.current_pos - info.request_pos
#define FILL 0x5A