[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:24 PST 2024


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

None

>From 572af3b355c7802f70b49a5a0985840c69e4f77d Mon Sep 17 00:00:00 2001
From: Rose <83477269+AtariDreams at users.noreply.github.com>
Date: Fri, 26 Jan 2024 16:22:44 -0500
Subject: [PATCH] [libc] abs is a const function

---
 libc/src/stdlib/abs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
 



More information about the libc-commits mailing list