[cfe-dev] interesting clang issue with "floor"

Eli Friedman eli.friedman at gmail.com
Fri Jul 26 22:06:12 PDT 2013


On Fri, Jul 26, 2013 at 8:48 PM, reed kotler <rkotler at mips.com> wrote:
> My point was that the function attributes for floor and floor_ are
> different, even though the definitions are the same.
>
> This is a follow on email.
>
> floor has nounwind and readnone whereas floor_ has neither of those.
>
> But you can override them so how can it know that these attributes are valid
> for the ones that I create?

If you define your own floor function, your program has undefined
behavior.  See 7.1.3 in the C standard.

-Eli



More information about the cfe-dev mailing list