lkml.org 
[lkml]   [2002]   [Jan]   [9]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 9 Jan 2002 20:47:15 +0100 (CET)
FromGérard_Roudier <>
SubjectRe: [PATCH] C undefined behavior fix

On Tue, 8 Jan 2002, J.A. Magallon wrote:

>
> On 20020107 jtv wrote:
> >
> >Let's say we have this simplified version of the problem:
> >
> >	int a = 3;
> >	{
> >		volatile int b = 10;
>
>     >>>>>>>>> here b changes

Hmmm...
Then your hardware is probably broken or may-be you are dreaming. :-)

There is nothing in this code that requires the compiler to allocate
memory for 'b'. You just invent the volatile constant concept. :)

> >		a += b;
> >	}
> >
> >Is there really language in the Standard preventing the compiler from
> >constant-folding this code to "int a = 13;"?

Gérard.

-
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 12:15    [W:0.257 / U:0.170 seconds]
©2003-2008 Jasper Spaans