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

reed kotler rkotler at mips.com
Fri Jul 26 22:17:21 PDT 2013


On 07/26/2013 10:06 PM, Eli Friedman wrote:
> 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
I trust your reading the C standard here.

I was looking at clang here to try and understand the nature of an llvm 
issue.

My main issue is with llvm (as opposed to clang) regarding floor.

the signature recorded for floor is void floor(void) .

whereas with sin and many others for example, it is as expected float 
sin(float)

I've posted that issue on the llvm dev list.




More information about the cfe-dev mailing list