This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Questions about the ATTRS field of builtins.def

I'm trying to make sense of the ATTRS field in builtins.def.  For the
math functions, I see several variants:


2.  flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST

3.  flag_errno_math ? ATTR_NOTHROW_LIST
                                : (flag_unsafe_math_optimizations
                                   ? ATTR_CONST_NOTHROW_LIST
                                   : ATTR_PURE_NOTHROW_LIST)

I understand 1 and I understand 3's errno check.  What I don't
understand is number 2, or why 3 contains 2 in one of its clauses.
When is 2 necessary and why?

I also see many discrepancies.  E.g. "cos" uses 2, but "round" and
others use case 1.  What makes "cos" need case 2?  What's odd is that
the man page on x86-linux says "round" may set errno to EDOM so
shouldn't it (and perhaps others) use number 3?

Finally, is there a complete online reference somewhere that lists all
of the C90 vs C99 math functions and explains which names were
reserved in C90 but unimplemented until C99?  (This will help me
decide which DEF_* macro to use on each function.)

Kaveh R. Ghazi

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]