[libc-commits] [libc] [libc] abs is a const function (PR #79650)

via libc-commits libc-commits at lists.llvm.org
Fri Jan 26 13:23:54 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: AtariDreams (AtariDreams)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/79650.diff


1 Files Affected:

- (modified) libc/src/stdlib/abs.h (+1-1) 


``````````diff
diff --git a/libc/src/stdlib/abs.h b/libc/src/stdlib/abs.h
index 19cef1446bd36df..ccfdccf2024a9e7 100644
--- a/libc/src/stdlib/abs.h
+++ b/libc/src/stdlib/abs.h
@@ -11,7 +11,7 @@
 
 namespace LIBC_NAMESPACE {
 
-int abs(int n);
+int __attribute__((__const__)) abs(int n);
 
 } // namespace LIBC_NAMESPACE
 

``````````

</details>


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


More information about the libc-commits mailing list