lkml.org 
[lkml]   [2000]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: (*(unsigned long *)&jiffies)++;
Date
From
>	Exactly. What's the point of declaring it as volatile if you're later 
>going
>to cast the volatile away? The compiler has the right to ignore the fact
>that it's volatile at that point.

The `volatile' is there so that loops like

oldtime = jiffies;
while ((jiffies - oldtime) < HZ)
;

work. It serves no useful purpose when assigning to the variable, and casting
it away prevents other optimisations from being inhibited.

p.



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

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