lkml.org 
[lkml]   [2020]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectAW: [PATCH 04/24] eventfd.2: Use 'PRIxN' macros when printing C99 fixed-width integer types
Date
I do not think that this is a good idea.
An example should be clear and easy to understand.
(e.g. with reduced error handling)

These C99 macros are over the top for me.

jm2c
wh
________________________________________
Von: linux-man-owner@vger.kernel.org [linux-man-owner@vger.kernel.org] im Auftrag von Alejandro Colomar [colomar.6.4.3@gmail.com]
Gesendet: Donnerstag, 10. September 2020 23:13
An: mtk.manpages@gmail.com
Cc: linux-man@vger.kernel.org; linux-kernel@vger.kernel.org; Alejandro Colomar
Betreff: [PATCH 04/24] eventfd.2: Use 'PRIxN' macros when printing C99 fixed-width integer types

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
---
man2/eventfd.2 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/eventfd.2 b/man2/eventfd.2
index 929234ab7..71e9d85b4 100644
--- a/man2/eventfd.2
+++ b/man2/eventfd.2
@@ -386,6 +386,7 @@ Parent read 28 (0x1c) from efd
.EX
#include <sys/eventfd.h>
#include <unistd.h>
+#include <inttypes.h> /* Definition of PRIu64 & PRIx64 */
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h> /* Definition of uint64_t */
@@ -430,8 +431,7 @@ main(int argc, char *argv[])
s = read(efd, &u, sizeof(uint64_t));
if (s != sizeof(uint64_t))
handle_error("read");
- printf("Parent read %llu (0x%llx) from efd\en",
- (unsigned long long) u, (unsigned long long) u);
+ printf("Parent read %"PRIu64" (0x%"PRIx64") from efd\en", u, u);
exit(EXIT_SUCCESS);

case \-1:
--
2.28.0
\
 
 \ /
  Last update: 2020-09-11 19:39    [W:0.223 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site