c - Does the C99 standard permit assignment of a variable to itself? -


does c99 standard allow variables assigned themselves? instance, following valid:

int = 42;  /* case 1 */ = a;  /* case 2 */ int *b = &a; = *b; 

while suspect case 1 valid, i'm hesitant same case 2.

in case of assignment, right side evaluated before assigning value variable on left -- or race condition introduced when dereferencing pointer variable being assigned?

both cases valid, since value of a used determine value stored, not determine object in value store.

in essence in assignment have distinguish 3 different operations

  • determine object value stored
  • evaluate rhs
  • store determined value in determined object

the first 2 of these 3 operations can done in order, in parallel. third consequence of 2 others, come after.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -