Warning suppression
I'm compiling my code using clang-cl 6.0.0, and get several warnings when using NS_IMPLEMENT_INLINE_REFLECTION. Looking through noesis' headers, I figured out that there's a warning suppression mechanism, yet the NS_CLANG_WARNING_DISABLE(x) macro does basically nothing (located at CompilerSettings.h:71, according to clang). On the other hand, similar defines for MSVC and g++ actually use some compiler-specific directives and presumably do their job. Is this a bug, or a feature? Might I be doing something wrong?
Re: Warning suppression
When compiling with Visual Studio, the macro is empty
But when compiling with clang it is defined as
I think the problem is that you are compiling using clang from Visual Studio right? So far we don't support that combination, we didn't have time to try yet. But anyways, you don't need to use our macros to suppress warnings, you can use your own ones.
What's the warning about by the way?
Code: Select all
#define NS_CLANG_WARNING_DISABLE(x)
Code: Select all
#define NS_CLANG_WARNING_DISABLE(x) _Pragma(NS_STRINGIFY(clang diagnostic ignored x))
What's the warning about by the way?
Re: Warning suppression
I am actually building from command line using cmake, nmake and clang-cl, which is a msvc-compatible clang (clang++ being g++ compatible on the other hand). Noesis 2.1.0f1 (r6972).
Here are the warnings that I get: https://pastebin.com/hKivBFnR
The first one pops up several times for each of my headers, the second one once for each one. The headers I'm talking about contain the following code:
Also, the definition changes from a stub to an actual one only if compiling with g++ (clang++ in that case), due to the following code (CompilerSettings.h:147):
Whereas in the MSC branch of the if pragma the corresponding code consists of simply (CompilerSettings.h:70):
Replacing the latter with the former in noesis headers solves the -Winconsistent-missing-override warning, but the other one persists.
Here are the warnings that I get: https://pastebin.com/hKivBFnR
The first one pops up several times for each of my headers, the second one once for each one. The headers I'm talking about contain the following code:
Code: Select all
NS_IMPLEMENT_INLINE_REFLECTION(MyWindow, NoesisApp::Window)
{
NsMeta<Noesis::TypeId>("MyId");
}
Code: Select all
#ifdef __clang__
#define NS_CLANG_HAS_WARNING(x) __has_warning(x)
#define NS_CLANG_WARNING_DISABLE(x) _Pragma(NS_STRINGIFY(clang diagnostic ignored x))
#else
#define NS_CLANG_HAS_WARNING(x) 0
#define NS_CLANG_WARNING_DISABLE(x)
#endif
Code: Select all
#define NS_CLANG_HAS_WARNING(x) 0
#define NS_CLANG_WARNING_DISABLE(x)
Re: Warning suppression
Thanks for the details. For now I recommend including Noesis from a single header (you can use the provided PCH header for that) and silence all the warnings using standard mechanisms (not using Noesis macros, they are there for internal usage).
Once we have time to properly support clang in Visual Studio we will address all these problems. We care about having no warnings when our code is compiled by clients.
Once we have time to properly support clang in Visual Studio we will address all these problems. We care about having no warnings when our code is compiled by clients.
Who is online
Users browsing this forum: Google [Bot] and 4 guests