lkml.org 
[lkml]   [2002]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Bug in kernel code?
On 27 Aug 2002 at 18:23, David S. Miller wrote:

> From: "Stephen C. Biggs" <s.biggs@softier.com>
> Date: Tue, 27 Aug 2002 18:24:13 -0700
>
> On 27 Aug 2002 at 18:09, David S. Miller wrote:
>
> > And then your mail ends.... let us know when you've fixed
> > your email client, this isn't rocket science :-)
> >
>
> What are you talking about "And then your mail ends..." That's all I wanted to say...
>
> No, I thought you were going to give an example of a huge number.
> :-)
>

How about (unsigned long)(~0)?

This code never finishes:

#include <stdio.h>

#define PAGE_SHIFT 12

struct list_head {
struct list_head *next, *prev;
};

int main(void)
{
unsigned long order;
unsigned long mempages = ~0;

#if PAGE_SHIFT < 13
mempages >>= (13 - PAGE_SHIFT);
#endif
mempages *= sizeof(struct list_head);

for (order = 0; ((1UL << order) << PAGE_SHIFT) < mempages; order++)
;
printf("%d\n",order);
return 0;
}

-
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 13:28    [W:0.100 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site