Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: changes to examples to match new coding guidelines

...

Code Block
bgColor#FFCCCC
langc
#define assign(uc1, uc2, val) uc1##uc2 = val;

void func(void) {
  int \u0401;
  /* ... */
  assign( \u04, 01, 4);

  /* ... */
}

Implementation Details

This code compiles and runs with Microsoft Visual Studio 2012, assigning 4 to the variable as expected.

...

Code Block
bgColor#ccccff
langc
#define assign(ucn, val) ucn = val;
void func(void) {
  int \u0401;
  /* ... */
  assign( \u0401, 4);

  /* ... */
}

Risk Assessment

Creating a universal character name through token concatenation results in undefined behavior.

...