Versions Compared

Key

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

...

If the putc() macro evaluates its stream argument multiple times, this might still seem safe, as the ternary conditional expression ostensibly prevents multiple calls to fopen(). However, there is no guarantee that these calls would happen in distinct sequence points. Consequently, this code also violates EXP30-C. Do not depend on order of evaluation for side - effects.

Compliant Solution (putc)

...

 

...