You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When compiling with Visual Studio (using compound single-file catch.hpp) with /W4, Visual Studio warns about non-ascii character found in catch.hpp.
NOTE: I'm NOT using an English version of Windows.
Expected behavior
Don't use non-ascii characters in Catch source files... as they are not necessary.
Reproduction steps
Just
#defineCATCH_CONFIG_MAIN
#include"./catch.hpp"
is enough to trigger the VS warning.
Platform information:
OS: Windows 10
Compiler+version: Visual Studio 2017 15.9.7
Catch version: v2.6.1
Additional context
Non-ascii characters exists in 2 lines of compound single-file catch.hpp (v2.6.1):
@@ -3815,7 +3815,7 @@ namespace Generators {
template<typename L>
// Note: The type after -> is weird, because VS2015 cannot parse
// the expression used in the typedef inside, when it is in
- // return type. Yeah, ¯\_(ツ)_/¯+ // return type. Yeah.
auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
using UnderlyingType = typename decltype(generatorExpression())::type;
@@ -13315,7 +13315,7 @@ public:
case Unit::Nanoseconds:
return "ns";
case Unit::Microseconds:
- return "µs";+ return "us";
case Unit::Milliseconds:
return "ms";
case Unit::Seconds:
For the first occurrence, just remove the emoticon in the comment.
For the second occurrence, consider two ways:
As the diff above shows, use English letter u instead of Greek letter µ. It's clear for users to understand us refers to microseconds.
Use an escape sequence for Greek letter µ, like return "\x????s";. But you have to choose an encoding first.
Personally, I strongly suggest the first approach, since the bytes presentation of µ may vary among encodings.
The text was updated successfully, but these errors were encountered:
Describe the bug
When compiling with Visual Studio (using compound single-file
catch.hpp
) with/W4
, Visual Studio warns about non-ascii character found incatch.hpp
.NOTE: I'm NOT using an English version of Windows.
Expected behavior
Don't use non-ascii characters in Catch source files... as they are not necessary.
Reproduction steps
Just
is enough to trigger the VS warning.
Platform information:
Additional context
Non-ascii characters exists in 2 lines of compound single-file
catch.hpp
(v2.6.1):For the first occurrence, just remove the emoticon in the comment.
For the second occurrence, consider two ways:
u
instead of Greek letterµ
. It's clear for users to understandus
refers to microseconds.µ
, likereturn "\x????s";
. But you have to choose an encoding first.Personally, I strongly suggest the first approach, since the bytes presentation of
µ
may vary among encodings.The text was updated successfully, but these errors were encountered: