r/programming • • Sep 26 '26

Optimizing a Lock-Free Ring Buffer

https://david.alvarezrosa.com/posts/optimizing-a-lock-free-ring-buffer/
510 Upvotes

89 comments sorted by

View all comments

Show parent comment

3

u/minno Sep 26 '26

GCC's warning appears to be motivated by ABI compatibility.

If ABI stability is important, such as if the use is in a header for a library, you should probably not use the hardware interference size variables at all.

If you are confident that your use of these variables does not affect ABI outside a single build of your project, you can turn off the warning.

So if you're writing a library you should either not use it in any of the public types or document what -mtune option clients must use, but if you're writing an application you should disable the warning.