[LLVMdev] [RFC] New function attributes for errno-setting functions

Krzysztof Parzyszek kparzysz at codeaurora.org
Tue Sep 17 12:10:02 PDT 2013

On 9/12/2013 7:44 PM, Hal Finkel wrote:
>    1. 'writes-only-errno'
>    2. 'errno-ignored'

Do we really need the first one?  We already know which standard 
functions could potentially set errno, and we know which standard 
functions don't modify any other storage (other than that which is 
passed via parameters).  I think it's safe to assume that standard 
functions can be recognized by name, since the standard prohibits user 
objects to use a predefined name.

We could have an attribute like "side-effects-ignored" indicating that 
whatever modifications the given function makes, nobody will read them 
(at least not without an intervening store).  This would include errno, 
but could also be used in more general contexts.


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation

More information about the llvm-dev mailing list