linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Frank Rowand <frank.rowand@am.sony.com>
Cc: Clark Williams <williams@redhat.com>, linux-rt-users@vger.kernel.org
Subject: Re: [PATCH] rt-tests, cyclictest - fix printf format for 32 bit systems
Date: Thu, 29 Sep 2011 09:35:36 +0200	[thread overview]
Message-ID: <20110929073536.GE6949@pengutronix.de> (raw)
In-Reply-To: <4E839D28.5020603@am.sony.com>

On Wed, Sep 28, 2011 at 03:18:16PM -0700, Frank Rowand wrote:
> 
> The printf() format for a uint64_t is %l on a 64 bit system and %ll on
> a 32 bit system.  Use the ugly but portable format descriptor.
> 
> Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
> ---
>  src/cyclictest/cyclictest.c |    3 	2 +	1 -	0 !
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Index: b/src/cyclictest/cyclictest.c
> ===================================================================
> --- a/src/cyclictest/cyclictest.c
> +++ b/src/cyclictest/cyclictest.c
> @@ -24,6 +24,7 @@
>  #include <time.h>
>  #include <errno.h>
>  #include <limits.h>
> +#include <inttypes.h>
>  #include <linux/unistd.h>
>  
>  #include <sys/prctl.h>
> @@ -1561,7 +1562,7 @@ int main(int argc, char **argv)
>  		print_tids(parameters, num_threads);
>  		if (break_thread_id) {
>  			printf("# Break thread: %d\n", break_thread_id);
> -			printf("# Break value: %lu\n", break_thread_value);
> +			printf("# Break value: %" PRIu64 "\n", break_thread_value);
If you consider this ugly, you might prefer

	printf("# Break value: %llu\n", (unsigned long long)break_thread_value);

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2011-09-29  7:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28 22:18 [PATCH] rt-tests, cyclictest - fix printf format for 32 bit systems Frank Rowand
2011-09-29  7:35 ` Uwe Kleine-König [this message]

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=20110929073536.GE6949@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=frank.rowand@am.sony.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.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;
as well as URLs for NNTP newsgroup(s).