linux-mips
[Top] [All Lists]

Re: gcc warning in my trace_benchmark() code

To: David Daney <ddaney.cavm@gmail.com>
Subject: Re: gcc warning in my trace_benchmark() code
From: Steven Rostedt <rostedt@goodmis.org>
Date: Thu, 5 Jun 2014 14:53:39 -0400
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
In-reply-to: <5390BA9D.3090402@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20140605121204.18ee5f2d@gandalf.local.home> <5390A4F0.3000601@gmail.com> <20140605133500.190eb31d@gandalf.local.home> <5390BA9D.3090402@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
On Thu, 05 Jun 2014 11:44:45 -0700
David Daney <ddaney.cavm@gmail.com> wrote:

> > But stddev is s64. Ah, but the compare is:
> >
> > (void)(((typeof((n)) *)0) == ((uint64_t *)0));
> >
> > so it's complaining about a signed verses unsigned compare, not length.
> > I think I can ignore this warning then.
> 
> The pedant in me thinks that you should fix your code if using do_div() 
> on a signed object is undefined.  But if you aren't planning on merging 
> the code, then it probably doesn't matter.

It's undefined on signed 64 numbers? Where is that documented. I don't
see it in the comments, and I don't see anything in the Documentation
directory. It only states that n must be 64bit. It doesn't say unsigned
64 bit.

And yes I do plan on merging this. It's in my 3.16 queue right now and
in linux-next. But it's just a benchmark tracepoint that requires a
config option to enable it. It will show up in your allmodconfig builds
but nothing important.

Worse comes to worse, I can add a (u64) to the call to do_div() I guess.

> 
> >
> > Thoughts?
> 
> I think I will have lunch now...
> 

I just came back from lunch. It was quite delicious!

-- Steve


<Prev in Thread] Current Thread [Next in Thread>