lkml.org 
[lkml]   [2009]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/7] tracing: typecast sizeof and offsetof to unsigned int
On Tue, 10 Mar 2009 00:57:11 -0400 Steven Rostedt <rostedt@goodmis.org> wrote:

> On x86_64 sizeof and offsetof are treated as long, where as on x86_32
> they are int. This patch typecasts them to unsigned int to avoid
> one arch giving warnings while the other does not.

Actually, both have type size_t.

> static int trace_write_header(struct trace_seq *s)
> {
> @@ -457,11 +458,11 @@ static int trace_write_header(struct trace_seq *s)
>
> /* struct trace_entry */
> return trace_seq_printf(s,
> - "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
> - "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
> - "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
> - "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
> - "\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
> + "\tfield:%s %s;\toffset:%u;\tsize:%u;\n"
> + "\tfield:%s %s;\toffset:%u;\tsize:%u;\n"
> + "\tfield:%s %s;\toffset:%u;\tsize:%u;\n"
> + "\tfield:%s %s;\toffset:%u;\tsize:%u;\n"
> + "\tfield:%s %s;\toffset:%u;\tsize:%u;\n"

Which may be printed with %z.


\
 
 \ /
  Last update: 2009-03-10 06:25    [W:0.441 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site