Avoid casting (void**) values. #875

pull roconnor-blockstream wants to merge 1 commits into bitcoin-core:master from roconnor-blockstream:20210123_void_star_star changing 1 files +1 −1
  1. roconnor-blockstream commented at 8:37 PM on January 23, 2021: contributor

    Replaced with an expression that only casts (void*) values.

    While casting between void * and foo * generally allowed (upto alignment issues), the same cannot be said for casting between void ** and foo ** values, which is not okay in general.

    While the C standard which says "A pointer to void shall have the same representation and alignment requirements as a pointer to a character type.” likely implies the cast is sound because void * and char * values have the same representation, perhaps it is better to rewrite the expression to not require a careful reading of the standard to be correct.

  2. Avoid casting (void**) values.
    Replaced with an expression that only casts (void*) values.
    2730618604
  3. sipa commented at 10:13 PM on January 23, 2021: contributor

    utACK 27306186045955803ca4070783c6a28853003e6a

    I can't imagine that on realistic platforms there is a difference between the two, so if the new code is more convincingly valid by a strict reading of the standard, let's use that.

  4. real-or-random approved
  5. real-or-random commented at 6:01 PM on January 24, 2021: contributor
  6. jonasnick approved
  7. jonasnick commented at 1:35 PM on January 25, 2021: contributor

    utACK 27306186045955803ca4070783c6a28853003e6a

  8. jonasnick merged this on Jan 25, 2021
  9. jonasnick closed this on Jan 25, 2021

  10. roconnor-blockstream deleted the branch on Jan 25, 2021
  11. Fabcien referenced this in commit 882ec0ad46 on Apr 8, 2021
  12. deadalnix referenced this in commit 0486f5d75f on Apr 9, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me