User: Password:
|
|
Subscribe / Log in / New account

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.


(Log in to post comments)


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds