refactor: Drop noop gcc version checks #20491

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:201125-gcc changing 3 files +4 −12
  1. hebasto commented at 12:27 PM on November 25, 2020: member

    Since #20413 the minimum required GCC version is 7.

  2. fanquake commented at 12:28 PM on November 25, 2020: member

    I think these are included in #19183. Also, unless we added that check, I'm not sure if we want to modify nanobench.

    Edit: Saying that. #19183 is being split up/possibly blocked, so if the nanobench change is removed, I don't mind if this is merged earlier.

  3. Drop noop gcc version checks
    Since #20413 the minimum required GCC version is 7.
    
    Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
    830ddf4139
  4. hebasto force-pushed on Nov 25, 2020
  5. hebasto commented at 12:41 PM on November 25, 2020: member

    I think these are included in #19183. Also, unless we added that check, I'm not sure if we want to modify nanobench.

    Edit: Saying that. #19183 is being split up/possibly blocked, so if the nanobench change is removed, I don't mind if this is merged earlier.

    Removed nanobench change, and added credits to @practicalswift.

  6. MarcoFalke added the label Refactoring on Nov 25, 2020
  7. MarcoFalke renamed this:
    Drop noop gcc version checks
    refactor: Drop noop gcc version checks
    on Nov 25, 2020
  8. in src/test/fuzz/multiplication_overflow.cpp:17 in 830ddf4139
      13 | @@ -14,7 +14,7 @@
      14 |  #if __has_builtin(__builtin_mul_overflow)
      15 |  #define HAVE_BUILTIN_MUL_OVERFLOW
      16 |  #endif
      17 | -#elif defined(__GNUC__) && (__GNUC__ >= 5)
      18 | +#elif defined(__GNUC__)
    


    MarcoFalke commented at 1:11 PM on November 25, 2020:

    isn't this covered by the previous check already?

    https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Integer-Overflow-Builtins.html


    hebasto commented at 1:25 PM on November 25, 2020:

    Thanks! Updated.


    hebasto commented at 9:20 PM on November 28, 2020:

    Reverted back due to @fanquake's comment.

  9. hebasto force-pushed on Nov 25, 2020
  10. laanwj commented at 4:25 PM on November 25, 2020: member

    Code review ACK a526ab4fca37d8148e45705c97da49da3aa36fae

  11. MarcoFalke requested review from practicalswift on Nov 25, 2020
  12. fanquake commented at 7:52 AM on November 26, 2020: member

    I'm not sure this is correct, or at-least, now that this is only using __has_builtin() for the builtin checks, they wont be defined for GCC < 10, as that was the first version to get __has_builtin().

    New built-in functions: The __has_builtin built-in preprocessor operator can be used to query support for built-in functions provided by GCC and other compilers that support it.

    Is that the desired behavior? I assume that's why it also has a check for __GNUC__.

    i.e:

    #include <iostream>
    
    int main() {
    #if defined(__has_builtin)
            std::cout << "has __has_builtin()\n";
    #endif
            return 0;
    }
    
    g++ --version
    g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
    
    g++ test.cpp && ./a.out
    # not avaliable
    
    g++-10 test.cpp && ./a.out
    has __has_builtin()
    
  13. hebasto force-pushed on Nov 28, 2020
  14. hebasto commented at 9:21 PM on November 28, 2020: member

    I'm not sure this is correct, or at-least, now that this is only using __has_builtin() for the builtin checks, they wont be defined for GCC < 10, as that was the first version to get __has_builtin().

    Updated (reverted back).

  15. fanquake approved
  16. fanquake commented at 7:54 AM on November 30, 2020: member

    ACK 830ddf413934226d0b6ca99165916790cc52ca18

  17. fanquake merged this on Nov 30, 2020
  18. fanquake closed this on Nov 30, 2020

  19. hebasto deleted the branch on Nov 30, 2020
  20. sidhujag referenced this in commit 888a0d5b5c on Nov 30, 2020
  21. christiancfifi referenced this in commit 116dcb6693 on Oct 3, 2021
  22. christiancfifi referenced this in commit 3ab1378747 on Oct 4, 2021
  23. christiancfifi referenced this in commit e447c4e0cd on Oct 11, 2021
  24. pravblockc referenced this in commit 8d0121b435 on Nov 18, 2021
  25. MarcoFalke locked this on Feb 15, 2022

github-metadata-mirror

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

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