Skip to content

Conversation

@fanquake
Copy link
Contributor

Note that __STDC_VERSION__ version checks are currently performed 3 different ways in this codebase. Not sure if you want to consolidate how they are done? The other two being:

#if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)

#if defined(DEBUG) && (__STDC_VERSION__ >= 199901L) && (__GNUC__ >= 3)

@miniupnp miniupnp self-assigned this Jun 17, 2021
@miniupnp miniupnp merged commit 8f9ce75 into miniupnp:master Jun 17, 2021
@fanquake fanquake deleted the fix_std_c_version_check branch July 29, 2021 06:42
laanwj added a commit to bitcoin-core/gui that referenced this pull request Jun 16, 2022
…ANDARD in depends

f7595f1 build: add and use CXX_STANDARD in depends (fanquake)
7e7b3e4 build: add and use C_STANDARD in depends (fanquake)

Pull request description:

  By explicitly setting a C standard version we avoid any potential for issues/differences in libraries that may come about due to C STD version, as well as avoid potentially being opted into newer code / features in libraries when compiler defaults change (i.e as of 11.0.0, Clang now defaults to gnu17 over gnu11).

  This should be a no-op for our release builds, because it's just explicitly setting the default that is [already being used](https://github.com/fanquake/core-review/blob/master/compiler-defaults.md). However this is relevant for anyone building depends with a newer compiler.

  I found [one broken `__STDC_VERSION__` check in the](miniupnp/miniupnp#552) miniupnpc header.

  At the same time, add `CXX_STANDARD` for setting our C++ standard, and use that over setting `-std=c++17` for cxx packages.

  Guix builds:
  ```bash
  ```

ACKs for top commit:
  dongcarl:
    Code Review ACK f7595f1
  laanwj:
    Code review ACK f7595f1

Tree-SHA512: 9255190d91ba3de20762b1d6af35c59d64f3d77a52bbe9a3f1dfb6bcf16daef66054ebef96b58e7285cd01bf613e69a78bd5e8681c21293e254f23d1fa7b0f71
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 17, 2022
…n depends

f7595f1 build: add and use CXX_STANDARD in depends (fanquake)
7e7b3e4 build: add and use C_STANDARD in depends (fanquake)

Pull request description:

  By explicitly setting a C standard version we avoid any potential for issues/differences in libraries that may come about due to C STD version, as well as avoid potentially being opted into newer code / features in libraries when compiler defaults change (i.e as of 11.0.0, Clang now defaults to gnu17 over gnu11).

  This should be a no-op for our release builds, because it's just explicitly setting the default that is [already being used](https://github.com/fanquake/core-review/blob/master/compiler-defaults.md). However this is relevant for anyone building depends with a newer compiler.

  I found [one broken `__STDC_VERSION__` check in the](miniupnp/miniupnp#552) miniupnpc header.

  At the same time, add `CXX_STANDARD` for setting our C++ standard, and use that over setting `-std=c++17` for cxx packages.

  Guix builds:
  ```bash
  ```

ACKs for top commit:
  dongcarl:
    Code Review ACK f7595f1
  laanwj:
    Code review ACK f7595f1

Tree-SHA512: 9255190d91ba3de20762b1d6af35c59d64f3d77a52bbe9a3f1dfb6bcf16daef66054ebef96b58e7285cd01bf613e69a78bd5e8681c21293e254f23d1fa7b0f71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants