Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added a bit about redefining standard library identifiers causing undefined behavior.

...

Code Block
bgColor#FFcccc
#include <stdio.h>
#define fputs(X,Y) fputs(Y,X)

However, according to clause 7.1.3 of C99, the behavior of a program that defines a symbol, including a macro, with the same name as that of a standard library function, type, macro, or other reserved identifier, is undefined.

Doing so without running afoul of the C requirement mentioned above this makes the code difficult to read, for example, by causing confusion when moving between code that follows this convention and code that does not. In effect, it becomes impossible to modify an interface once that interface has been broadly adopted. Consequently, it is important to get the interface design right the first time.

...