Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
int main(void) {
  int a = 14;
  int b = sizeof( a++ );
  printf("a, b = %d, %d.\n", a, b);  /* prints a, b = 14, 4. */...
  return 0;
}

The expression a++ is not evaluated. Consequently, side effects in the expression are not executed.

Implementation Specific Details

This example compiles cleanly under Microsoft Visual Studio 2005 Version 8.0, with the /W4 option.

Compliant Solution

In this compliant solution, the variable a is incremented.

Code Block

int main(void) {
  int a = 14;
  int b = sizeof(a);
  a++;
  ...
  return 0;
}

Implementation Specific Details

This example compiles cleanly under Microsoft Visual Studio 2005 Version 8.0, with the /W4 option.

...