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

Windows Clang GNU command line warnings #253

Closed
DaanDeMeyer opened this issue Jul 18, 2019 · 1 comment
Closed

Windows Clang GNU command line warnings #253

DaanDeMeyer opened this issue Jul 18, 2019 · 1 comment

Comments

@DaanDeMeyer
Copy link
Contributor

DaanDeMeyer commented Jul 18, 2019

I'm back with more warnings from an even more obscure setup.

CMake 3.15 just released with support for using clang/clang++ on Windows instead of clang-cl. Compiling doctest with this results in a few issues:

  1. clang++ on Windows needs to be in C++14 mode to work with MSVC stdlib headers.

We can solve this by setting the doctest_with_main standard to C++14 if this specific setup is used.

  1. Some unused macro warnings:
../doctest/parts/doctest.cpp:3:9: warning: macro is not used [-Wunused-macros]
#define DOCTEST_LIBRARY_IMPLEMENTATION
        ^
../doctest/parts/doctest.cpp:130:9: warning: macro is not used [-Wunused-macros]
#define VC_EXTRA_LEAN
        ^

I'm not sure if these are false positives or actually valid.

  1. A non-portable system include warning:
../doctest/parts\doctest.cpp:140:10: error: non-portable path to file '<Windows.h>'; specified path differs in case from file name on disk [-Werror,-Wnonportable-system-include-path]
#include <windows.h>
         ^~~~~~~~~~~
         <Windows.h>
@DaanDeMeyer DaanDeMeyer mentioned this issue Jul 18, 2019
@onqtam
Copy link
Member

onqtam commented Aug 11, 2019

wow - the unused macro DOCTEST_LIBRARY_IMPLEMENTATION warning is weird - it's a standard include guard technique... maybe the compiler distinguishes between .cpp and .h files and reports it only for defines from a .cpp file......

onqtam pushed a commit that referenced this issue Aug 11, 2019
* Use Windows.h instead of windows.h

Fixes part of #253.

* Remove `VC_EXTRA_LEAN`.

Fixes part of #253. `VC_EXTRA_LEAN` doesn't appear anywhere in Windows.h
(at least on my machine, only `WIN32_LEAN_AND_MEAN` does) so it seems
safe to remove it.

* Ignore Wunused-macros warning for DOCTEST_LIBRARY_IMPLEMENTATION.

Removing the macro lead to compilation errors so its definitely a false
positive.
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