From: "Jiří Paleček" <jpalecek@web.de>
To: Garrett Cooper <yanegomi@gmail.com>
Cc: "ltp-list@lists.sourceforge.net" <ltp-list@lists.sourceforge.net>
Subject: [LTP] Patch from 4.11.
Date: Sat, 19 Dec 2009 03:06:00 +0100 [thread overview]
Message-ID: <op.u45xgah3u2flwt@debian> (raw)
Hello,
in your patch from 4.11., "1. Use linux_syscall_numbers.h. 2. Fix a format
string (use inttypes.h)....", there is:
@@ -174,7 +177,7 @@ void test_mbind(void)
ret = 1;
return;
}
- printf("%lx\n", addr);
+ printf("%" __PRI64_PREFIX "x\n", (long) addr);
ret = mbind(addr, len, MPOL_BIND, &mask, 8 * sizeof(mask), 0);
}
I am not happy with that, particularly:
1. You use a 64-bit format specifier, but pass a long. A long may not be
64-bit, in which case the code is buggy.
2. You use __PRI64_PREFIX, which, as all underscore-prefixed names is an
implementation detail of the library.
3. Why didn't use just printf("%p\n", addr), when addr is a void* and "p"
is a format specifier for pointers.
Regards
Jiri Palecek
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next reply other threads:[~2009-12-19 2:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-19 2:06 Jiří Paleček [this message]
2009-12-19 5:23 ` [LTP] Patch from 4.11 Garrett Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.u45xgah3u2flwt@debian \
--to=jpalecek@web.de \
--cc=ltp-list@lists.sourceforge.net \
--cc=yanegomi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox