concurrencykit / ck

Concurrency primitives, safe memory reclamation mechanisms and non-blocking (including lock-free) data structures designed to aid in the research, design and implementation of high performance concurrent systems developed in C99+.
http://concurrencykit.org/
Other
2.34k stars 312 forks source link

Correct array parameter notation in CK_PR_LOAD_2() #218

Closed pkelsey closed 5 months ago

pkelsey commented 5 months ago

This type of array size notation in C serves only a documentation purpose. That the array-size documentation provided in this macro-templated inline function declaration is not correct for any of the instantiations would be a minor nit except that gcc versions that support -Wstringop-overread and/or -Wstringop-overflow use the array sizes as guidance for when to generate those warnings (errors under -Werror).

An alternative would be to change the parameter types to explicitly be pointers - this fix preserves the documentation intent.

This resolves #185.

cognet commented 5 months ago

Hi @pkelsey !

I'm not sure I understand why you're changing it to W * sizeof(T), and not just W ?

pkelsey commented 5 months ago

Hi @pkelsey !

I'm not sure I understand why you're changing it to W * sizeof(T), and not just W ?

I was in the process of pushing the fix for that as you were typing I think. I have no explanation, so am left to feebly point at the hour of the day and the quality of the coffee.

cognet commented 5 months ago

Ahahah that is a perfectly good explanation, merged, thanks a lot!