[libc-commits] [libc] [libc][stdfix] Add abs functions for signed fixed point types. (PR #81823)

via libc-commits libc-commits at lists.llvm.org
Thu Feb 15 14:54:22 PST 2024


================
@@ -7,6 +7,13 @@ def StdcExt : StandardSpec<"stdc_ext"> {
       [],  // types
       [],  // enums
       [    // functions
+          GuardedFunctionSpec<"abshr", RetValSpec<ShortFractType>, [ArgSpec<ShortFractType>], "LIBC_COMPILER_HAS_FIXED_POINT">,
----------------
lntue wrote:

I think we should still put it in the guards, since the types still require specific compiler flag, and if the `stdfix.h` is included somewhere transitively in the users' codes where it's not being used, and they cannot easily control the header inclusions, it will force the users to add the compiler flag, or a hard compile errors.

By keeping the guards here, users can explicitly control when to enable it with the compiler flags.

https://github.com/llvm/llvm-project/pull/81823


More information about the libc-commits mailing list