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

Warnings when using something more than /W4 for Visual Studio #95

Closed
Leandros opened this issue Oct 19, 2017 · 4 comments
Closed

Warnings when using something more than /W4 for Visual Studio #95

Leandros opened this issue Oct 19, 2017 · 4 comments

Comments

@Leandros
Copy link

There is a bug in the switch in getAssertString, it's not handling all cases:

c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_throws' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'
c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_throws_as' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'
c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_nothrow' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'
c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_fast' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'
c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_false' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'
c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_unary' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'
c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_eq' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'
c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_ne' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'
c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_lt' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'
c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_gt' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'
c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_ge' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'
c:\<redacted>\tests\doctest.h(3854,9): error C4062: enumerator 'doctest::detail::assertType::is_le' in switch of enum 'doctest::detail::assertType::Enum' is not handled
c:\<redacted>\tests\doctest.h(1018): note: see declaration of 'doctest::detail::assertType::Enum'

@Leandros Leandros changed the title Turn on OCLint again getAssertString not handling all cases Oct 19, 2017
@onqtam
Copy link
Member

onqtam commented Oct 20, 2017

Hi!

It's not a bug - see here - the first N values of the enum are used later (with bitwise OR) to define the assert types.

So OCLint is reporting this for you? You might suppress errors from the header in some way. I also use OCLing on the CI (travis) - see here - but I suppress some things (after I've reviewed each case that the static analyzer reported)

@Leandros
Copy link
Author

MSVC is reporting this, since I'm compiling with warnings enabled & treated as error.

@onqtam
Copy link
Member

onqtam commented Oct 24, 2017

Oh I see... that warning is a level 4 (and doctest is built with /W4 on multiple versions of VS) but is off by default... see here - I'll fix this in a few days/weeks - thanks for reporting!

@onqtam onqtam changed the title getAssertString not handling all cases Warnings when using something more than /W4 for Visual Studio Oct 28, 2017
onqtam added a commit that referenced this issue Oct 28, 2017
@onqtam
Copy link
Member

onqtam commented Oct 28, 2017

This should be fixed in the dev branch - will end up in master very soon!

onqtam added a commit that referenced this issue Oct 28, 2017
…loat was getting stored in memory and not in a register... relates #95
@onqtam onqtam closed this as completed in abf39d2 Oct 29, 2017
onqtam added a commit that referenced this issue Oct 29, 2017
…loat was getting stored in memory and not in a register... relates #95
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

No branches or pull requests

2 participants