* [PATCH 5/5] lib.c: Add __sync_lock_test_and_set as a builtin function
@ 2013-05-21 19:19 Ramsay Jones
2013-05-23 3:15 ` Christopher Li
0 siblings, 1 reply; 3+ messages in thread
From: Ramsay Jones @ 2013-05-21 19:19 UTC (permalink / raw)
To: Christopher Li; +Cc: Sparse Mailing-list
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
lib.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib.c b/lib.c
index 7e822eb..2dca810 100644
--- a/lib.c
+++ b/lib.c
@@ -779,6 +779,7 @@ void declare_builtin_functions(void)
add_pre_buffer("extern double __builtin_fabs(double);\n");
add_pre_buffer("extern void __sync_synchronize();\n");
add_pre_buffer("extern int __sync_bool_compare_and_swap(void *, ...);\n");
+ add_pre_buffer("extern int __sync_lock_test_and_set(volatile long *const, const long);\n");
/* Add Blackfin-specific stuff */
add_pre_buffer(
--
1.8.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 5/5] lib.c: Add __sync_lock_test_and_set as a builtin function
2013-05-21 19:19 [PATCH 5/5] lib.c: Add __sync_lock_test_and_set as a builtin function Ramsay Jones
@ 2013-05-23 3:15 ` Christopher Li
2013-05-25 19:40 ` Ramsay Jones
0 siblings, 1 reply; 3+ messages in thread
From: Christopher Li @ 2013-05-23 3:15 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Sparse Mailing-list
On Tue, May 21, 2013 at 12:19 PM, Ramsay Jones
<ramsay@ramsay1.demon.co.uk> wrote:
> + add_pre_buffer("extern int __sync_lock_test_and_set(volatile long *const, const long);\n");
Looking at the gcc documents about atomic builtins. quote:
"and further that they are overloaded such that they work on multiple types"
Sparse does not do type overload. Which means sparse can't properly support this
function right now. If some one try to use this function on an int
type, sparse will
complain about type mismatch.
Chris
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 5/5] lib.c: Add __sync_lock_test_and_set as a builtin function
2013-05-23 3:15 ` Christopher Li
@ 2013-05-25 19:40 ` Ramsay Jones
0 siblings, 0 replies; 3+ messages in thread
From: Ramsay Jones @ 2013-05-25 19:40 UTC (permalink / raw)
To: Christopher Li; +Cc: Sparse Mailing-list
Christopher Li wrote:
> On Tue, May 21, 2013 at 12:19 PM, Ramsay Jones
> <ramsay@ramsay1.demon.co.uk> wrote:
>> + add_pre_buffer("extern int __sync_lock_test_and_set(volatile long *const, const long);\n");
>
> Looking at the gcc documents about atomic builtins. quote:
> "and further that they are overloaded such that they work on multiple types"
>
Ah, yes, I obviously didn't investigate this carefully enough! :(
OK, so we can forget about this patch.
Thanks!
ATB,
Ramsay Jones
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-25 20:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-21 19:19 [PATCH 5/5] lib.c: Add __sync_lock_test_and_set as a builtin function Ramsay Jones
2013-05-23 3:15 ` Christopher Li
2013-05-25 19:40 ` Ramsay Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).