Versions Compared

Key

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

...

Wiki Markup
In this noncompliant code example \[[GCC Bugs|http://gcc.gnu.org/bugs.html#nonbugs_c]\], the author uses preprocessor directives to specify platform-specific arguments to {{memcpy()}}.  However, if {{memcpy()}} is implemented using a macro, the code will resultresults in undefined behavior.  For example, this code will compile using GCC version 3.3 and later, but will not compile using GCC versions prior to 3.3 if {{memcpy()}} is a macro.

Code Block
bgColor#FFCCCC
memcpy(dest, src,
#ifdef PLATFORM1
  12
#else
  24
#endif
);

...