Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC with cxx17 standard fails to compile #154

Closed
AndreaLanfranchi opened this issue Jul 31, 2020 · 2 comments · Fixed by #156
Closed

MSVC with cxx17 standard fails to compile #154

AndreaLanfranchi opened this issue Jul 31, 2020 · 2 comments · Fixed by #156
Assignees

Comments

@AndreaLanfranchi
Copy link

AndreaLanfranchi commented Jul 31, 2020

Huntered ethash in another Cmake project with cxx17 standard.
MSVC fails to compile due to warning (treated as error) C4211 triggered here https://github.com/chfast/ethash/blob/master/lib/ethash/builtins.h#L24-L37

@chfast chfast self-assigned this Jul 31, 2020
@chfast
Copy link
Owner

chfast commented Jul 31, 2020

Ok, I will take a look.

@chfast
Copy link
Owner

chfast commented Aug 2, 2020

I cannot reproduce it on the side: https://godbolt.org/z/3q9coq.
Can you provide the full error and compiler invocation?

AndreaLanfranchi added a commit to erigontech/silkworm that referenced this issue Aug 4, 2020
* repoint FILEPATH to local hunter config
* fix ethash version 0.5.2 which fixes chfast/ethash#154
yperbasis added a commit to erigontech/silkworm that referenced this issue Aug 5, 2020
* Add exclusion for .vs folder

* Add CMakeSettings.json for VS 2019 builds

buildRoot and installRoot can be customized by user but actual values can pretty much fit everybody as long there's enough space for binaries non %system% drive

* Temporarily disable sub project ethash
* gives build issues on MSVC
* not referenced anywhere yet

* Revert "Temporarily disable sub project ethash"

This reverts commit 9cb7e13.

* Add Hunter config at top level
* repoint FILEPATH to local hunter config
* fix ethash version 0.5.2 which fixes chfast/ethash#154

* Windows build : Silence warnings

* C5030 unrecognized gnu:xxx attributes

* Try to fix secp256k1 under Windows

* Wrong warning ids exclusion

* Enforce CXX20 for silkworm

* Revert "Enforce CXX20 for silkworm"

This reverts commit 439acf2.

CXX 20 imposure breaks abseil included headers due to dropped support for already deprecated CXX17 standards.
For example result_of<CallableType> is invalid;

* Remove designated initializers

* Winbuild compatibility.
For MSVC basic_string_view::iterator is an interal class not a pointer. Use .data() which returns the pointer to first char of the view (same as .begin())

* Remove designated initializers

* Add linker dependency to ntdll.lib

* Remove leftover from conflict resolution

* Add <intrin.h> for Win __popcnt

* Link ntdll.lib to silkworm

Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
AE1020 added a commit to AE1020/CRoaring that referenced this issue Sep 16, 2020
These functions in portability.h are defined `static inline`:

    __builtin_ctzll
    __builtin_clzll
    __builtin_popcountll

But with C++17 in Visual C++ 2019 (Visual Studio 16.7.3) this causes:

  warning C4211: nonstandard extension used: redefined extern to static

Removing the `static` allows it to compile.

For an example of another project making such a patch, see e.g. the
Ethereum hash code:

https://github.com/chfast/ethash/pull/156/files
chfast/ethash#154
AE1020 added a commit to AE1020/CRoaring that referenced this issue Sep 16, 2020
These functions in portability.h are defined `static inline`:

    __builtin_ctzll
    __builtin_clzll
    __builtin_popcountll

But with C++17 in Visual C++ 2019 (Visual Studio 16.7.3) this causes:

  warning C4211: nonstandard extension used: redefined extern to static

Removing the `static` allows it to compile.

For an example of another project making such a patch, see e.g. the
Ethereum hash code:

https://github.com/chfast/ethash/pull/156/files
chfast/ethash#154
AE1020 added a commit to AE1020/CRoaring that referenced this issue Sep 16, 2020
These functions in portability.h are defined `static inline`:

    __builtin_ctzll
    __builtin_clzll
    __builtin_popcountll

But with C++17 in Visual C++ 2019 (Visual Studio 16.7.3) this causes:

  warning C4211: nonstandard extension used: redefined extern to static

Removing the `static` allows it to compile.

For an example of another project making such a patch, see e.g. the
Ethereum hash code:

https://github.com/chfast/ethash/pull/156/files
chfast/ethash#154
AE1020 added a commit to AE1020/CRoaring that referenced this issue Sep 16, 2020
These functions in portability.h are defined `static inline`:

    __builtin_ctzll
    __builtin_clzll
    __builtin_popcountll

But with C++17 in Visual C++ 2019 (Visual Studio 16.7.3) this causes:

  warning C4211: nonstandard extension used: redefined extern to static

Removing the `static` allows it to compile.

For an example of another project making such a patch, see e.g. the
Ethereum hash code:

https://github.com/chfast/ethash/pull/156/files
chfast/ethash#154
lemire pushed a commit to RoaringBitmap/CRoaring that referenced this issue Sep 16, 2020
These functions in portability.h are defined `static inline`:

    __builtin_ctzll
    __builtin_clzll
    __builtin_popcountll

But with C++17 in Visual C++ 2019 (Visual Studio 16.7.3) this causes:

  warning C4211: nonstandard extension used: redefined extern to static

Removing the `static` allows it to compile.

For an example of another project making such a patch, see e.g. the
Ethereum hash code:

https://github.com/chfast/ethash/pull/156/files
chfast/ethash#154
ishida0415 pushed a commit to ishida0415/CRoaring that referenced this issue May 2, 2024
These functions in portability.h are defined `static inline`:

    __builtin_ctzll
    __builtin_clzll
    __builtin_popcountll

But with C++17 in Visual C++ 2019 (Visual Studio 16.7.3) this causes:

  warning C4211: nonstandard extension used: redefined extern to static

Removing the `static` allows it to compile.

For an example of another project making such a patch, see e.g. the
Ethereum hash code:

https://github.com/chfast/ethash/pull/156/files
chfast/ethash#154
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 a pull request may close this issue.

2 participants