3 ms·
> These are not workarounds. What is the purpose of this line? Why do you think it's there if the C code using volatile is enough on its own? https://github.
by chrisseaton 7y ago
> These are not workarounds.
What is the purpose of this line?
Why do you think it's there if the C code using volatile is enough on its own?
https://github.com/jedisct1/libsodium/blob/a26467874a512de304f6e7e25d98af549963de9f/src/libsodium/sodium/utils.c#L131 https://github.com/jedisct1/libsodium/blob/a26467874a512de30...
It's a workaround to prevent optimisations because that happens to be how some compilers are implemented today. Will it be implemented like that tomorrow or in a different compiler? Who knows.
https://github.com/jedisct1/libsodium/commit/27872ca13c713c90cd5576722a3f672a73d4c9f6 https://github.com/jedisct1/libsodium/commit/27872ca13c713c9...
- megous 7y agoThat line is not present at all if volatile using variant of the function is used.