All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] rt-tests: printf format compile warning
@ 2012-05-03 19:48 Frank Rowand
  2012-05-03 21:13 ` Darren Hart
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Rowand @ 2012-05-03 19:48 UTC (permalink / raw)
  To: linux-rt-users, williams; +Cc: jkacur, dvhart


V2: use type casting instead of ugly constant in format string


Fix printf format string to fix compile warning for ARM 32 bit target.

Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
---
 src/cyclictest/cyclictest.c |    2 	1 +	1 -	0 !
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/src/cyclictest/cyclictest.c
===================================================================
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1575,7 +1575,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: %llu\n", (unsigned long long)break_thread_value);
 		}
 	}
 	


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] rt-tests: printf format compile warning
  2012-05-03 19:48 [PATCH v2] rt-tests: printf format compile warning Frank Rowand
@ 2012-05-03 21:13 ` Darren Hart
  2012-05-03 21:26   ` Clark Williams
  0 siblings, 1 reply; 5+ messages in thread
From: Darren Hart @ 2012-05-03 21:13 UTC (permalink / raw)
  To: frank.rowand; +Cc: linux-rt-users, williams, jkacur



On 05/03/2012 12:48 PM, Frank Rowand wrote:
> 
> V2: use type casting instead of ugly constant in format string
> 
> 
> Fix printf format string to fix compile warning for ARM 32 bit target.
> 

Oh much better. :-)

> Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
> ---
>  src/cyclictest/cyclictest.c |    2 	1 +	1 -	0 !
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: b/src/cyclictest/cyclictest.c
> ===================================================================
> --- a/src/cyclictest/cyclictest.c
> +++ b/src/cyclictest/cyclictest.c
> @@ -1575,7 +1575,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: %llu\n", (unsigned long long)break_thread_value);
>  		}
>  	}
>  	
> 

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] rt-tests: printf format compile warning
  2012-05-03 21:13 ` Darren Hart
@ 2012-05-03 21:26   ` Clark Williams
  2012-05-03 22:37     ` John Kacur
  0 siblings, 1 reply; 5+ messages in thread
From: Clark Williams @ 2012-05-03 21:26 UTC (permalink / raw)
  To: Darren Hart; +Cc: frank.rowand, linux-rt-users, jkacur

[-- Attachment #1: Type: text/plain, Size: 1157 bytes --]

On Thu, 03 May 2012 14:13:56 -0700
Darren Hart <dvhart@linux.intel.com> wrote:

> 
> 
> On 05/03/2012 12:48 PM, Frank Rowand wrote:
> > 
> > V2: use type casting instead of ugly constant in format string
> > 
> > 
> > Fix printf format string to fix compile warning for ARM 32 bit target.
> > 
> 
> Oh much better. :-)
> 
> > Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
> > ---
> >  src/cyclictest/cyclictest.c |    2 	1 +	1 -	0 !
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Index: b/src/cyclictest/cyclictest.c
> > ===================================================================
> > --- a/src/cyclictest/cyclictest.c
> > +++ b/src/cyclictest/cyclictest.c
> > @@ -1575,7 +1575,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: %llu\n", (unsigned long long)break_thread_value);
> >  		}
> >  	}
> >  	
> > 
> 
>

Yes, I like this better. I pulled the original and applied this.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] rt-tests: printf format compile warning
  2012-05-03 21:26   ` Clark Williams
@ 2012-05-03 22:37     ` John Kacur
  2012-05-03 22:41       ` John Kacur
  0 siblings, 1 reply; 5+ messages in thread
From: John Kacur @ 2012-05-03 22:37 UTC (permalink / raw)
  To: Clark Williams; +Cc: Darren Hart, frank.rowand, linux-rt-users, jkacur

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1627 bytes --]



On Thu, 3 May 2012, Clark Williams wrote:

> On Thu, 03 May 2012 14:13:56 -0700
> Darren Hart <dvhart@linux.intel.com> wrote:
> 
> > 
> > 
> > On 05/03/2012 12:48 PM, Frank Rowand wrote:
> > > 
> > > V2: use type casting instead of ugly constant in format string
> > > 
> > > 
> > > Fix printf format string to fix compile warning for ARM 32 bit target.
> > > 
> > 
> > Oh much better. :-)
> > 
> > > Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
> > > ---
> > >  src/cyclictest/cyclictest.c |    2 	1 +	1 -	0 !
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > Index: b/src/cyclictest/cyclictest.c
> > > ===================================================================
> > > --- a/src/cyclictest/cyclictest.c
> > > +++ b/src/cyclictest/cyclictest.c
> > > @@ -1575,7 +1575,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: %llu\n", (unsigned long long)break_thread_value);
> > >  		}
> > >  	}
> > >  	
> > > 
> > 
> >
> 
> Yes, I like this better. I pulled the original and applied this.

Well, I really hate the C99 macros too, they're uglier than sin. But, you 
want to fix a compiler error on 32-bit by creating one on 64-bits? What 
are you guys smoking?

NAK

The above patch creates the following error on 64-bit
src/cyclictest/cyclictest.c:1564:4: warning: format ‘%llu’ expects 
argument of type ‘long long unsigned int’, but argument 2 has type 
‘uint64_t’ [-Wformat]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] rt-tests: printf format compile warning
  2012-05-03 22:37     ` John Kacur
@ 2012-05-03 22:41       ` John Kacur
  0 siblings, 0 replies; 5+ messages in thread
From: John Kacur @ 2012-05-03 22:41 UTC (permalink / raw)
  To: Clark Williams; +Cc: Darren Hart, frank.rowand, linux-rt-users, jkacur

On Fri, May 4, 2012 at 12:37 AM, John Kacur <jkacur@redhat.com> wrote:
>
>
> On Thu, 3 May 2012, Clark Williams wrote:
>
>> On Thu, 03 May 2012 14:13:56 -0700
>> Darren Hart <dvhart@linux.intel.com> wrote:
>>
>> >
>> >
>> > On 05/03/2012 12:48 PM, Frank Rowand wrote:
>> > >
>> > > V2: use type casting instead of ugly constant in format string
>> > >
>> > >
>> > > Fix printf format string to fix compile warning for ARM 32 bit target.
>> > >
>> >
>> > Oh much better. :-)
>> >
>> > > Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
>> > > ---
>> > >  src/cyclictest/cyclictest.c |    2       1 +     1 -     0 !
>> > >  1 file changed, 1 insertion(+), 1 deletion(-)
>> > >
>> > > Index: b/src/cyclictest/cyclictest.c
>> > > ===================================================================
>> > > --- a/src/cyclictest/cyclictest.c
>> > > +++ b/src/cyclictest/cyclictest.c
>> > > @@ -1575,7 +1575,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: %llu\n", (unsigned long long)break_thread_value);
>> > >           }
>> > >   }
>> > >
>> > >
>> >
>> >
>>
>> Yes, I like this better. I pulled the original and applied this.
>
> Well, I really hate the C99 macros too, they're uglier than sin. But, you
> want to fix a compiler error on 32-bit by creating one on 64-bits? What
> are you guys smoking?
>
> NAK
>
> The above patch creates the following error on 64-bit
> src/cyclictest/cyclictest.c:1564:4: warning: format ‘%llu’ expects
> argument of type ‘long long unsigned int’, but argument 2 has type
> ‘uint64_t’ [-Wformat]

Ok, obviously, it's me who must have been smoking something. My bad, my bad.
there is a cast in there.

That patch is way better, sorry. I approve!
--
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-03 22:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-03 19:48 [PATCH v2] rt-tests: printf format compile warning Frank Rowand
2012-05-03 21:13 ` Darren Hart
2012-05-03 21:26   ` Clark Williams
2012-05-03 22:37     ` John Kacur
2012-05-03 22:41       ` John Kacur

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.