I think his worry is the pedantic reason that without the volatile gcc is
allowed to write code that chokes and dies if xtime happens to change in a
volatile manner. The example given earlier was:
code as written:
kprintf("%d\n",xtime.tv_usec);
code as compiled by gcc (with xtime not specified as volatile):
suseconds_t temp = xtime.tv_usec;
if (temp != xtime.tv_usec)
BUG();
kprintf"%d\n",temp);
I hope that gcc would not do such a thing, but I think a case could be made that
it could do it and still comply with the language standard.
Of course, since the linux kernel is an important thing for gcc to compile, I
can't imagine them doing something that would break it on purpose without a
really good reason.
Chris
-- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com - 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/