bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

test-base64 warnings


From: Bruno Haible
Subject: test-base64 warnings
Date: Fri, 30 May 2008 02:14:33 +0200
User-agent: KMail/1.5.4

Hi Simon,

While testing the coreutils-6.11.104-00a30 coreutils snapshot on
MacOS X 10.5, I got these warnings:

test-base64.c: In function 'main':
test-base64.c:121: warning: format '%d' expects type 'int', but argument 3 has 
type 'size_t'
test-base64.c:131: warning: format '%d' expects type 'int', but argument 3 has 
type 'size_t'
test-base64.c:142: warning: format '%d' expects type 'int', but argument 3 has 
type 'size_t'
test-base64.c:153: warning: format '%d' expects type 'int', but argument 3 has 
type 'size_t'
test-base64.c:164: warning: format '%d' expects type 'int', but argument 3 has 
type 'size_t'
test-base64.c:175: warning: format '%d' expects type 'int', but argument 3 has 
type 'size_t'

This indicates actually incorrect test code on 64-bit platforms.

To printf a value of type 'size_t', I usually cast it to 'unsigned long' and
then use '%lu', not '%d'.

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]