[MDEV-13218] warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ Created: 2017-06-29  Updated: 2017-07-05  Resolved: 2017-07-05

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.2.6
Fix Version/s: 10.2.7

Type: Bug Priority: Minor
Reporter: Guillermo Céspedes Tabárez Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: compile, warning
Environment:

Debian 8.8 x32 - Digitalocean

  1. uname -a
    Linux framework 3.16.0-4-686-pae #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26) i686 GNU/Linux

Issue Links:
Relates
relates to MDEV-13215 warning: format ‘%lu’ expects argumen... Closed
relates to MDEV-13217 warning: format ‘%lu’ expects argumen... Closed

 Description   

[ 43%] Building C object libmariadb/unittest/libmariadb/CMakeFiles/ps.dir/ps.c.o
/var/tmp/mariadb_build/mariadb_src/libmariadb/unittest/libmariadb/ps.c: In function ‘test_long_data_str1’:
/var/tmp/mariadb_build/mariadb_src/libmariadb/unittest/libmariadb/ps.c:1500:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ [-Wformat=]
diag("max_length: %lu max_blob_length: %lu", field->max_length, max_blob_length);
^



 Comments   
Comment by Daniel Black [ 2017-06-30 ]

The rest of the server code uses %z for size_t

Comment by Guillermo Céspedes Tabárez [ 2017-06-30 ]

Would it be correct to change it to %zu ?

Comment by Elena Stepanova [ 2017-07-03 ]

Can be seen in buildbot
http://buildbot.askmonty.org/buildbot/builders/kvm-deb-jessie-x86/builds/2482/steps/compile/logs/warnings%20%2856%29

Generated at Thu Feb 08 08:03:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.