Implications of pure and constant functions
Implications of pure and constant functions
Posted Jun 11, 2008 6:45 UTC (Wed) by nix (subscriber, #2304)In reply to: Implications of pure and constant functions by rsidd
Parent article: Implications of pure and constant functions
A classic example of a common class of functions that can't be optimized over even though you'd think it could be is *printf(). Standard printf() without %n can be freely optimized over, but alas glibc has an extension (user-defined format masks) that means printf() can call arbitrary functions for you. That nobody ever uses this extension is irrelevant: the compiler must assume that you might be.
 
           