[{"id":1758594,"web_url":"http://patchwork.ozlabs.org/comment/1758594/","msgid":"<CAJ+F1CKL67s4eEYa5N0yy7xZj8NBsmzjRwADJJtDuhAAOiOE2A@mail.gmail.com>","list_archive_url":null,"date":"2017-08-28T13:34:52","subject":"Re: [Qemu-devel] [PATCH] tests: fix incorrect size_t format in\n\tbenchmark-crypto","submitter":{"id":6442,"url":"http://patchwork.ozlabs.org/api/people/6442/","name":"Marc-André Lureau","email":"marcandre.lureau@gmail.com"},"content":"On Mon, Aug 28, 2017 at 1:38 PM Philippe Mathieu-Daudé <f4bug@amsat.org>\nwrote:\n\n>   $ make check-speed\n>   tests/benchmark-crypto-hash.c: In function 'test_hash_speed':\n>   tests/benchmark-crypto-hash.c:44:5: error: format '%ld' expects argument\n> of type 'long int', but argument 2 has type 'size_t' [-Werror=format=]\n>        g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n>        ^\n>   tests/benchmark-crypto-hash.c: In function 'main':\n>   tests/benchmark-crypto-hash.c:62:9: error: format '%lu' expects argument\n> of type 'long unsigned int', but argument 4 has type 'size_t'\n> [-Werror=format=]\n>            snprintf(name, sizeof(name), \"/crypto/hash/speed-%lu\", i);\n>            ^\n>   cc1: all warnings being treated as errors\n>   rules.mak:66: recipe for target 'tests/benchmark-crypto-hash.o' failed\n>   make: *** [tests/benchmark-crypto-hash.o] Error 1\n>\n> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n>\n\n Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n\n---\n> testing v2.10.0-rc4\n>\n>  tests/benchmark-crypto-cipher.c | 4 ++--\n>  tests/benchmark-crypto-hash.c   | 4 ++--\n>  tests/benchmark-crypto-hmac.c   | 4 ++--\n>  3 files changed, 6 insertions(+), 6 deletions(-)\n>\n> diff --git a/tests/benchmark-crypto-cipher.c\n> b/tests/benchmark-crypto-cipher.c\n> index c6a40929e4..cf98443468 100644\n> --- a/tests/benchmark-crypto-cipher.c\n> +++ b/tests/benchmark-crypto-cipher.c\n> @@ -59,7 +59,7 @@ static void test_cipher_speed(const void *opaque)\n>      total /= 1024 * 1024; /* to MB */\n>\n>      g_print(\"cbc(aes128): \");\n> -    g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n> +    g_print(\"Testing chunk_size %zu bytes \", chunk_size);\n>      g_print(\"done: %.2f MB in %.2f secs: \", total, g_test_timer_last());\n>      g_print(\"%.2f MB/sec\\n\", total / g_test_timer_last());\n>\n> @@ -80,7 +80,7 @@ int main(int argc, char **argv)\n>\n>      for (i = 512; i <= (64 * 1204); i *= 2) {\n>          memset(name, 0 , sizeof(name));\n> -        snprintf(name, sizeof(name), \"/crypto/cipher/speed-%lu\", i);\n> +        snprintf(name, sizeof(name), \"/crypto/cipher/speed-%zu\", i);\n>          g_test_add_data_func(name, (void *)i, test_cipher_speed);\n>      }\n>\n> diff --git a/tests/benchmark-crypto-hash.c b/tests/benchmark-crypto-hash.c\n> index 6769d2a11b..122bfb6b85 100644\n> --- a/tests/benchmark-crypto-hash.c\n> +++ b/tests/benchmark-crypto-hash.c\n> @@ -41,7 +41,7 @@ static void test_hash_speed(const void *opaque)\n>\n>      total /= 1024 * 1024; /* to MB */\n>      g_print(\"sha256: \");\n> -    g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n> +    g_print(\"Testing chunk_size %zu bytes \", chunk_size);\n>      g_print(\"done: %.2f MB in %.2f secs: \", total, g_test_timer_last());\n>      g_print(\"%.2f MB/sec\\n\", total / g_test_timer_last());\n>\n> @@ -59,7 +59,7 @@ int main(int argc, char **argv)\n>\n>      for (i = 512; i <= (64 * 1204); i *= 2) {\n>          memset(name, 0 , sizeof(name));\n> -        snprintf(name, sizeof(name), \"/crypto/hash/speed-%lu\", i);\n> +        snprintf(name, sizeof(name), \"/crypto/hash/speed-%zu\", i);\n>          g_test_add_data_func(name, (void *)i, test_hash_speed);\n>      }\n>\n> diff --git a/tests/benchmark-crypto-hmac.c b/tests/benchmark-crypto-hmac.c\n> index 72408be987..c30250df3e 100644\n> --- a/tests/benchmark-crypto-hmac.c\n> +++ b/tests/benchmark-crypto-hmac.c\n> @@ -56,7 +56,7 @@ static void test_hmac_speed(const void *opaque)\n>      total /= 1024 * 1024; /* to MB */\n>\n>      g_print(\"hmac(sha256): \");\n> -    g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n> +    g_print(\"Testing chunk_size %zu bytes \", chunk_size);\n>      g_print(\"done: %.2f MB in %.2f secs: \", total, g_test_timer_last());\n>      g_print(\"%.2f MB/sec\\n\", total / g_test_timer_last());\n>\n> @@ -74,7 +74,7 @@ int main(int argc, char **argv)\n>\n>      for (i = 512; i <= (64 * 1204); i *= 2) {\n>          memset(name, 0 , sizeof(name));\n> -        snprintf(name, sizeof(name), \"/crypto/hmac/speed-%lu\", i);\n> +        snprintf(name, sizeof(name), \"/crypto/hmac/speed-%zu\", i);\n>          g_test_add_data_func(name, (void *)i, test_hmac_speed);\n>      }\n>\n> --\n> 2.14.1\n>\n>\n> --\nMarc-André Lureau","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"ZTxbXTRO\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xgt815jQzz9sNq\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 28 Aug 2017 23:36:01 +1000 (AEST)","from localhost ([::1]:39901 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmKCt-0007cS-Nb\n\tfor incoming@patchwork.ozlabs.org; Mon, 28 Aug 2017 09:35:59 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:57851)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1dmKC4-0007LS-Uv\n\tfor qemu-devel@nongnu.org; Mon, 28 Aug 2017 09:35:10 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <marcandre.lureau@gmail.com>) id 1dmKC3-00007C-Do\n\tfor qemu-devel@nongnu.org; Mon, 28 Aug 2017 09:35:08 -0400","from mail-vk0-x243.google.com ([2607:f8b0:400c:c05::243]:37724)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <marcandre.lureau@gmail.com>)\n\tid 1dmKBz-0008Us-P8; Mon, 28 Aug 2017 09:35:03 -0400","by mail-vk0-x243.google.com with SMTP id z187so196867vkd.4;\n\tMon, 28 Aug 2017 06:35:03 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=HNyz/cS9mEmerBg1EhbE2BvUmXqn1q3+GgKdf31dpXo=;\n\tb=ZTxbXTROSAMQe1lJy7Joh6EThX9AStjxJCwGqusbsKclY0eEeC+EirxR6k2ty8osoo\n\tCDpG5FvO1NUo9Wbxe0WI745iXyG1O31gZCSynA28KnZn4JClUP8GJkNloNpK+R0o/4We\n\ttOdnYBSTqTppoD6ZOCHMqnszY9s1olOGQOKFRb1OBRZ8mUf+D8tZRtgpYebFdZbbGQJV\n\tu3Fcn6yXswlpMSG8VZSzQ1ZqBLFXdr6XH/XxJdmqDUY2g+ZyjS2bY3uUlvdDSHnOjGhs\n\t63qax8xV5WjCX2Mlo+HrbytwoR/SqhEIbkIEKRGT4aqwHUcdcJQFPC/FbXf2TFRi3vyA\n\tb8sA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=HNyz/cS9mEmerBg1EhbE2BvUmXqn1q3+GgKdf31dpXo=;\n\tb=qSu3aksSErF+FJIrP5+9+lY/XN5V6rzRx4eceF0zf6vTS1A0qmYMpNzQiGP7PmYQM0\n\t5CR7n6E807qE/hPesiRMFAUt6AmZgvbIutlvN755+YtTBrn57F1pB0C2mL0tjREQV1AL\n\tJry15WQkymfcCZbVRuo6C1emwrdkIWobtuE2PHRZVLIB5h/rUVyl9IQ1aC3cbQdJutAQ\n\tjgK/IiC9eOrJWmAufEyYO4rIyOa8vAMw+aCueJuOo7pSPUo2/xQvUbKoTFYYHf5Jf3sU\n\tYl/exz6oHra+JCoBrATdWPLTV260IUdT07UzXC/BiQ3f7yHjtfiKJvkc4feXD6VNVEB1\n\t2mFA==","X-Gm-Message-State":"AHYfb5jbToOMxyJWtbHMSY+3TmbWLhTEo3kZ+mj7LS7KxhG9SmqLiucC\n\teM5b1eiBtHFLsKfgU3u/cmkoH67ABA==","X-Received":"by 10.31.133.131 with SMTP id h125mr278844vkd.61.1503927303125; \n\tMon, 28 Aug 2017 06:35:03 -0700 (PDT)","MIME-Version":"1.0","References":"<20170828113737.12199-1-f4bug@amsat.org>","In-Reply-To":"<20170828113737.12199-1-f4bug@amsat.org>","From":"=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@gmail.com>","Date":"Mon, 28 Aug 2017 13:34:52 +0000","Message-ID":"<CAJ+F1CKL67s4eEYa5N0yy7xZj8NBsmzjRwADJJtDuhAAOiOE2A@mail.gmail.com>","To":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,\n\t\"Daniel P . Berrange\" <berrange@redhat.com>, Longpeng\n\t<longpeng2@huawei.com>","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400c:c05::243","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH] tests: fix incorrect size_t format in\n\tbenchmark-crypto","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-trivial@nongnu.org, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1758970,"web_url":"http://patchwork.ozlabs.org/comment/1758970/","msgid":"<59A4B3BD.6030505@huawei.com>","list_archive_url":null,"date":"2017-08-29T00:22:21","subject":"Re: [Qemu-devel] [PATCH] tests: fix incorrect size_t format in\n\tbenchmark-crypto","submitter":{"id":69776,"url":"http://patchwork.ozlabs.org/api/people/69776/","name":"Longpeng (Mike, Cloud Infrastructure Service Product Dept.)","email":"longpeng2@huawei.com"},"content":"On 2017/8/29 8:21, Longpeng (Mike) wrote:\n\n> \n> \n> On 2017/8/28 19:37, Philippe Mathieu-Daudé wrote:\n> \n>>   $ make check-speed\n>>   tests/benchmark-crypto-hash.c: In function 'test_hash_speed':\n>>   tests/benchmark-crypto-hash.c:44:5: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' [-Werror=format=]\n>>        g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n>>        ^\n>>   tests/benchmark-crypto-hash.c: In function 'main':\n>>   tests/benchmark-crypto-hash.c:62:9: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' [-Werror=format=]\n>>            snprintf(name, sizeof(name), \"/crypto/hash/speed-%lu\", i);\n>>            ^\n>>   cc1: all warnings being treated as errors\n>>   rules.mak:66: recipe for target 'tests/benchmark-crypto-hash.o' failed\n>>   make: *** [tests/benchmark-crypto-hash.o] Error 1\n>>\n>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n> \n> \n> Reviewed-by: Longpeng(Mike) <longpeng@@huawei.com>\n> \n\n\nSorry, s/@/2/\n\nReviewed-by: Longpeng(Mike) <longpeng2@huawei.com>\n\n>> ---\n>> testing v2.10.0-rc4\n>>\n>>  tests/benchmark-crypto-cipher.c | 4 ++--\n>>  tests/benchmark-crypto-hash.c   | 4 ++--\n>>  tests/benchmark-crypto-hmac.c   | 4 ++--\n>>  3 files changed, 6 insertions(+), 6 deletions(-)\n>>\n>> diff --git a/tests/benchmark-crypto-cipher.c b/tests/benchmark-crypto-cipher.c\n>> index c6a40929e4..cf98443468 100644\n>> --- a/tests/benchmark-crypto-cipher.c\n>> +++ b/tests/benchmark-crypto-cipher.c\n>> @@ -59,7 +59,7 @@ static void test_cipher_speed(const void *opaque)\n>>      total /= 1024 * 1024; /* to MB */\n>>  \n>>      g_print(\"cbc(aes128): \");\n>> -    g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n>> +    g_print(\"Testing chunk_size %zu bytes \", chunk_size);\n>>      g_print(\"done: %.2f MB in %.2f secs: \", total, g_test_timer_last());\n>>      g_print(\"%.2f MB/sec\\n\", total / g_test_timer_last());\n>>  \n>> @@ -80,7 +80,7 @@ int main(int argc, char **argv)\n>>  \n>>      for (i = 512; i <= (64 * 1204); i *= 2) {\n>>          memset(name, 0 , sizeof(name));\n>> -        snprintf(name, sizeof(name), \"/crypto/cipher/speed-%lu\", i);\n>> +        snprintf(name, sizeof(name), \"/crypto/cipher/speed-%zu\", i);\n>>          g_test_add_data_func(name, (void *)i, test_cipher_speed);\n>>      }\n>>  \n>> diff --git a/tests/benchmark-crypto-hash.c b/tests/benchmark-crypto-hash.c\n>> index 6769d2a11b..122bfb6b85 100644\n>> --- a/tests/benchmark-crypto-hash.c\n>> +++ b/tests/benchmark-crypto-hash.c\n>> @@ -41,7 +41,7 @@ static void test_hash_speed(const void *opaque)\n>>  \n>>      total /= 1024 * 1024; /* to MB */\n>>      g_print(\"sha256: \");\n>> -    g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n>> +    g_print(\"Testing chunk_size %zu bytes \", chunk_size);\n>>      g_print(\"done: %.2f MB in %.2f secs: \", total, g_test_timer_last());\n>>      g_print(\"%.2f MB/sec\\n\", total / g_test_timer_last());\n>>  \n>> @@ -59,7 +59,7 @@ int main(int argc, char **argv)\n>>  \n>>      for (i = 512; i <= (64 * 1204); i *= 2) {\n>>          memset(name, 0 , sizeof(name));\n>> -        snprintf(name, sizeof(name), \"/crypto/hash/speed-%lu\", i);\n>> +        snprintf(name, sizeof(name), \"/crypto/hash/speed-%zu\", i);\n>>          g_test_add_data_func(name, (void *)i, test_hash_speed);\n>>      }\n>>  \n>> diff --git a/tests/benchmark-crypto-hmac.c b/tests/benchmark-crypto-hmac.c\n>> index 72408be987..c30250df3e 100644\n>> --- a/tests/benchmark-crypto-hmac.c\n>> +++ b/tests/benchmark-crypto-hmac.c\n>> @@ -56,7 +56,7 @@ static void test_hmac_speed(const void *opaque)\n>>      total /= 1024 * 1024; /* to MB */\n>>  \n>>      g_print(\"hmac(sha256): \");\n>> -    g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n>> +    g_print(\"Testing chunk_size %zu bytes \", chunk_size);\n>>      g_print(\"done: %.2f MB in %.2f secs: \", total, g_test_timer_last());\n>>      g_print(\"%.2f MB/sec\\n\", total / g_test_timer_last());\n>>  \n>> @@ -74,7 +74,7 @@ int main(int argc, char **argv)\n>>  \n>>      for (i = 512; i <= (64 * 1204); i *= 2) {\n>>          memset(name, 0 , sizeof(name));\n>> -        snprintf(name, sizeof(name), \"/crypto/hmac/speed-%lu\", i);\n>> +        snprintf(name, sizeof(name), \"/crypto/hmac/speed-%zu\", i);\n>>          g_test_add_data_func(name, (void *)i, test_hmac_speed);\n>>      }\n>>  \n> \n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xh9mZ2fG9z9s7m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 11:20:14 +1000 (AEST)","from localhost ([::1]:42256 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmVCO-0007lq-74\n\tfor incoming@patchwork.ozlabs.org; Mon, 28 Aug 2017 21:20:12 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:51424)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <longpeng2@huawei.com>) id 1dmUJ3-0007g5-9F\n\tfor qemu-devel@nongnu.org; Mon, 28 Aug 2017 20:23:02 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <longpeng2@huawei.com>) id 1dmUJ0-00014m-4T\n\tfor qemu-devel@nongnu.org; Mon, 28 Aug 2017 20:23:01 -0400","from szxga05-in.huawei.com ([45.249.212.191]:2247)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71)\n\t(envelope-from <longpeng2@huawei.com>)\n\tid 1dmUIz-000139-Ab; Mon, 28 Aug 2017 20:22:58 -0400","from 172.30.72.60 (EHLO DGGEMS407-HUB.china.huawei.com)\n\t([172.30.72.60])\n\tby dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued)\n\twith ESMTP id DGE01148; Tue, 29 Aug 2017 08:22:50 +0800 (CST)","from [127.0.0.1] (10.177.246.209) by DGGEMS407-HUB.china.huawei.com\n\t(10.3.19.207) with Microsoft SMTP Server id 14.3.301.0;\n\tTue, 29 Aug 2017 08:22:46 +0800"],"Message-ID":"<59A4B3BD.6030505@huawei.com>","Date":"Tue, 29 Aug 2017 08:22:21 +0800","From":"\"Longpeng (Mike)\" <longpeng2@huawei.com>","User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64;\n\trv:11.0) Gecko/20120327 Thunderbird/11.0.1","MIME-Version":"1.0","To":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","References":"<20170828113737.12199-1-f4bug@amsat.org>\n\t<59A4B375.7040307@huawei.com>","In-Reply-To":"<59A4B375.7040307@huawei.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"8bit","X-Originating-IP":"[10.177.246.209]","X-CFilter-Loop":"Reflected","X-Mirapoint-Virus-RAPID-Raw":"score=unknown(0),\n\trefid=str=0001.0A090201.59A4B3DC.00D0, ss=1, re=0.000, recu=0.000,\n\treip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0,\n\tso=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32","X-Mirapoint-Loop-Id":"21c6c8155415de47a68cfa6c6300c6a7","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]\n\t[fuzzy]","X-Received-From":"45.249.212.191","Subject":"Re: [Qemu-devel] [PATCH] tests: fix incorrect size_t format in\n\tbenchmark-crypto","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-trivial@nongnu.org, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1758972,"web_url":"http://patchwork.ozlabs.org/comment/1758972/","msgid":"<59A4B375.7040307@huawei.com>","list_archive_url":null,"date":"2017-08-29T00:21:09","subject":"Re: [Qemu-devel] [PATCH] tests: fix incorrect size_t format in\n\tbenchmark-crypto","submitter":{"id":69776,"url":"http://patchwork.ozlabs.org/api/people/69776/","name":"Longpeng (Mike, Cloud Infrastructure Service Product Dept.)","email":"longpeng2@huawei.com"},"content":"On 2017/8/28 19:37, Philippe Mathieu-Daudé wrote:\n\n>   $ make check-speed\n>   tests/benchmark-crypto-hash.c: In function 'test_hash_speed':\n>   tests/benchmark-crypto-hash.c:44:5: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' [-Werror=format=]\n>        g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n>        ^\n>   tests/benchmark-crypto-hash.c: In function 'main':\n>   tests/benchmark-crypto-hash.c:62:9: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' [-Werror=format=]\n>            snprintf(name, sizeof(name), \"/crypto/hash/speed-%lu\", i);\n>            ^\n>   cc1: all warnings being treated as errors\n>   rules.mak:66: recipe for target 'tests/benchmark-crypto-hash.o' failed\n>   make: *** [tests/benchmark-crypto-hash.o] Error 1\n> \n> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n\n\nReviewed-by: Longpeng(Mike) <longpeng@@huawei.com>\n\n> ---\n> testing v2.10.0-rc4\n> \n>  tests/benchmark-crypto-cipher.c | 4 ++--\n>  tests/benchmark-crypto-hash.c   | 4 ++--\n>  tests/benchmark-crypto-hmac.c   | 4 ++--\n>  3 files changed, 6 insertions(+), 6 deletions(-)\n> \n> diff --git a/tests/benchmark-crypto-cipher.c b/tests/benchmark-crypto-cipher.c\n> index c6a40929e4..cf98443468 100644\n> --- a/tests/benchmark-crypto-cipher.c\n> +++ b/tests/benchmark-crypto-cipher.c\n> @@ -59,7 +59,7 @@ static void test_cipher_speed(const void *opaque)\n>      total /= 1024 * 1024; /* to MB */\n>  \n>      g_print(\"cbc(aes128): \");\n> -    g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n> +    g_print(\"Testing chunk_size %zu bytes \", chunk_size);\n>      g_print(\"done: %.2f MB in %.2f secs: \", total, g_test_timer_last());\n>      g_print(\"%.2f MB/sec\\n\", total / g_test_timer_last());\n>  \n> @@ -80,7 +80,7 @@ int main(int argc, char **argv)\n>  \n>      for (i = 512; i <= (64 * 1204); i *= 2) {\n>          memset(name, 0 , sizeof(name));\n> -        snprintf(name, sizeof(name), \"/crypto/cipher/speed-%lu\", i);\n> +        snprintf(name, sizeof(name), \"/crypto/cipher/speed-%zu\", i);\n>          g_test_add_data_func(name, (void *)i, test_cipher_speed);\n>      }\n>  \n> diff --git a/tests/benchmark-crypto-hash.c b/tests/benchmark-crypto-hash.c\n> index 6769d2a11b..122bfb6b85 100644\n> --- a/tests/benchmark-crypto-hash.c\n> +++ b/tests/benchmark-crypto-hash.c\n> @@ -41,7 +41,7 @@ static void test_hash_speed(const void *opaque)\n>  \n>      total /= 1024 * 1024; /* to MB */\n>      g_print(\"sha256: \");\n> -    g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n> +    g_print(\"Testing chunk_size %zu bytes \", chunk_size);\n>      g_print(\"done: %.2f MB in %.2f secs: \", total, g_test_timer_last());\n>      g_print(\"%.2f MB/sec\\n\", total / g_test_timer_last());\n>  \n> @@ -59,7 +59,7 @@ int main(int argc, char **argv)\n>  \n>      for (i = 512; i <= (64 * 1204); i *= 2) {\n>          memset(name, 0 , sizeof(name));\n> -        snprintf(name, sizeof(name), \"/crypto/hash/speed-%lu\", i);\n> +        snprintf(name, sizeof(name), \"/crypto/hash/speed-%zu\", i);\n>          g_test_add_data_func(name, (void *)i, test_hash_speed);\n>      }\n>  \n> diff --git a/tests/benchmark-crypto-hmac.c b/tests/benchmark-crypto-hmac.c\n> index 72408be987..c30250df3e 100644\n> --- a/tests/benchmark-crypto-hmac.c\n> +++ b/tests/benchmark-crypto-hmac.c\n> @@ -56,7 +56,7 @@ static void test_hmac_speed(const void *opaque)\n>      total /= 1024 * 1024; /* to MB */\n>  \n>      g_print(\"hmac(sha256): \");\n> -    g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n> +    g_print(\"Testing chunk_size %zu bytes \", chunk_size);\n>      g_print(\"done: %.2f MB in %.2f secs: \", total, g_test_timer_last());\n>      g_print(\"%.2f MB/sec\\n\", total / g_test_timer_last());\n>  \n> @@ -74,7 +74,7 @@ int main(int argc, char **argv)\n>  \n>      for (i = 512; i <= (64 * 1204); i *= 2) {\n>          memset(name, 0 , sizeof(name));\n> -        snprintf(name, sizeof(name), \"/crypto/hmac/speed-%lu\", i);\n> +        snprintf(name, sizeof(name), \"/crypto/hmac/speed-%zu\", i);\n>          g_test_add_data_func(name, (void *)i, test_hmac_speed);\n>      }\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xh9qN31zBz9s75\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 11:22:40 +1000 (AEST)","from localhost ([::1]:42274 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmVEk-0001S9-B5\n\tfor incoming@patchwork.ozlabs.org; Mon, 28 Aug 2017 21:22:38 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:50957)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <longpeng2@huawei.com>) id 1dmUHu-0006fu-Pm\n\tfor qemu-devel@nongnu.org; Mon, 28 Aug 2017 20:21:52 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <longpeng2@huawei.com>) id 1dmUHr-0000Yf-Li\n\tfor qemu-devel@nongnu.org; Mon, 28 Aug 2017 20:21:50 -0400","from szxga04-in.huawei.com ([45.249.212.190]:2305)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71)\n\t(envelope-from <longpeng2@huawei.com>)\n\tid 1dmUHr-0000Wa-1Z; Mon, 28 Aug 2017 20:21:47 -0400","from 172.30.72.60 (EHLO DGGEMS409-HUB.china.huawei.com)\n\t([172.30.72.60])\n\tby dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued)\n\twith ESMTP id DGC01483; Tue, 29 Aug 2017 08:21:39 +0800 (CST)","from [127.0.0.1] (10.177.246.209) by DGGEMS409-HUB.china.huawei.com\n\t(10.3.19.209) with Microsoft SMTP Server id 14.3.301.0;\n\tTue, 29 Aug 2017 08:21:34 +0800"],"Message-ID":"<59A4B375.7040307@huawei.com>","Date":"Tue, 29 Aug 2017 08:21:09 +0800","From":"\"Longpeng (Mike)\" <longpeng2@huawei.com>","User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64;\n\trv:11.0) Gecko/20120327 Thunderbird/11.0.1","MIME-Version":"1.0","To":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","References":"<20170828113737.12199-1-f4bug@amsat.org>","In-Reply-To":"<20170828113737.12199-1-f4bug@amsat.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"8bit","X-Originating-IP":"[10.177.246.209]","X-CFilter-Loop":"Reflected","X-Mirapoint-Virus-RAPID-Raw":"score=unknown(0),\n\trefid=str=0001.0A090206.59A4B394.0160, ss=1, re=0.000, recu=0.000,\n\treip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0,\n\tso=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32","X-Mirapoint-Loop-Id":"9acc1e3706ae8fb592af440e1e44101c","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]\n\t[fuzzy]","X-Received-From":"45.249.212.190","Subject":"Re: [Qemu-devel] [PATCH] tests: fix incorrect size_t format in\n\tbenchmark-crypto","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-trivial@nongnu.org, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759384,"web_url":"http://patchwork.ozlabs.org/comment/1759384/","msgid":"<20170829142036.GD25801@redhat.com>","list_archive_url":null,"date":"2017-08-29T14:20:36","subject":"Re: [Qemu-devel] [PATCH] tests: fix incorrect size_t format in\n\tbenchmark-crypto","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Mon, Aug 28, 2017 at 08:37:37AM -0300, Philippe Mathieu-Daudé wrote:\n>   $ make check-speed\n>   tests/benchmark-crypto-hash.c: In function 'test_hash_speed':\n>   tests/benchmark-crypto-hash.c:44:5: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' [-Werror=format=]\n>        g_print(\"Testing chunk_size %ld bytes \", chunk_size);\n>        ^\n>   tests/benchmark-crypto-hash.c: In function 'main':\n>   tests/benchmark-crypto-hash.c:62:9: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' [-Werror=format=]\n>            snprintf(name, sizeof(name), \"/crypto/hash/speed-%lu\", i);\n>            ^\n>   cc1: all warnings being treated as errors\n>   rules.mak:66: recipe for target 'tests/benchmark-crypto-hash.o' failed\n>   make: *** [tests/benchmark-crypto-hash.o] Error 1\n> \n> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n> ---\n> testing v2.10.0-rc4\n> \n>  tests/benchmark-crypto-cipher.c | 4 ++--\n>  tests/benchmark-crypto-hash.c   | 4 ++--\n>  tests/benchmark-crypto-hmac.c   | 4 ++--\n>  3 files changed, 6 insertions(+), 6 deletions(-)\n\nThanks, added to my crypto queue, unless it merges through -trivial\nfirst.\n\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhW5z6jtXz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 00:21:27 +1000 (AEST)","from localhost ([::1]:45197 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmhOP-0008WD-RH\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 10:21:25 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:53042)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dmhNr-0008U3-B3\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 10:20:54 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dmhNh-0002w2-O7\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 10:20:51 -0400","from mx1.redhat.com ([209.132.183.28]:39026)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>)\n\tid 1dmhNh-0002vg-GI; Tue, 29 Aug 2017 10:20:41 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 67EC480099;\n\tTue, 29 Aug 2017 14:20:40 +0000 (UTC)","from redhat.com (unknown [10.33.36.95])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 3522D6E8BF;\n\tTue, 29 Aug 2017 14:20:38 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 67EC480099","Date":"Tue, 29 Aug 2017 15:20:36 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Message-ID":"<20170829142036.GD25801@redhat.com>","References":"<20170828113737.12199-1-f4bug@amsat.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170828113737.12199-1-f4bug@amsat.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tTue, 29 Aug 2017 14:20:40 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH] tests: fix incorrect size_t format in\n\tbenchmark-crypto","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"qemu-trivial@nongnu.org, Longpeng <longpeng2@huawei.com>,\n\tqemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]