lkml.org 
[lkml]   [2004]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: fork pagesize patch
Date

> > Sorry... I meant warning not error. It doesn't actually stop it building a
> > working kernel, but gcc _does_ complain, and not unreasonably, I think.
>
> I think it _is_ unreasonable. It's like doing
>
> if (a)
> x /= a;

Doing it with variables is not exactly the same. The compiler has been told to
optimise arithmetic on constants, and as such it has to represent a div-by-0
result, which obviously it can't.

Now, I agree that given the if-condition automatically precludes the div-by-0,
but maybe that's asking too much. Perhaps I should go and raise hell over it
with the gcc posse.

> Anyway, to make it not warn, why not change it to
>
> max_threads = mempages / (8*THREAD_SIZE/PAGE_SIZE);
>
> instead, and be done with it?

And drop the conditional entirely? I can go along with that.

> If the thread size is _that_ small that we still divide by zero, color me
> impressed.

Not unless you spell colour correctly:-)

David
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.065 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site