# Build warnings on Windows 10, VS 2019

**URL:** <https://forum.juce.com/t/build-warnings-on-windows-10-vs-2019/47883>\
**Category:** General JUCE discussion\
**Created:** [September 20, 2021, 7:54pm UTC](https://forum.juce.com/t/build-warnings-on-windows-10-vs-2019/47883 "2021-09-20T19:54:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anoesisaudio](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anoesisaudio/32/1132_2.png) [@anoesisaudio](https://forum.juce.com/u/anoesisaudio)\
**Post date:** [September 20, 2021, 7:54pm UTC](https://forum.juce.com/t/build-warnings-on-windows-10-vs-2019/47883/1 "2021-09-20T19:54:38Z")

</div>

I am getting the following warnings that appear to be related to **juce\_FocusTraverser.cpp** and I am somewhat at a loss.

Well, ok, I am lost but would like to understand. I think this is tell me that I am making the compiler look for something that does not exists or perhaps compare something against nothing.

_Has anyone else seen this and know where I might begin to understand it?_

Using Windows 10, VS 2019, current develop branch of JUCE. I don’t see the same using xcode.

```auto
In file included from ../JUCE/modules/juce_gui_basics/juce_gui_basics.cpp:130:
../JUCE/modules/juce_gui_basics/components/juce_FocusTraverser.cpp:61:52: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
            return getComponentOrderAttributes (a) < getComponentOrderAttributes (b);
                                                   ^
                                                   nullptr
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\tuple:759:97: note: while rewriting comparison as call to 'operator<=>' declared here      
_NODISCARD constexpr common_comparison_category_t<_Synth_three_way_result<_Types1, _Types2>...> operator<=>(
                                                                                                ^
../JUCE/modules/juce_gui_basics/components/juce_FocusTraverser.cpp:141:23: note: in instantiation of function template specialization 'juce::FocusHelpers::findAllComponents<bool (juce::Component::*)() const noexcept>' requested here
        FocusHelpers::findAllComponents (parentComponent,
                      ^
1 warning generated.
[159/162] Building CXX object plug-Example-syn/plug/CMakeFiles/plug-Example-syn_tests.dir/Debug/ __/__ /JUCE/modules/juce_gui_basics/juce_gui_basics.cpp.obj
In file included from ../JUCE/modules/juce_gui_basics/juce_gui_basics.cpp:130:
../JUCE/modules/juce_gui_basics/components/juce_FocusTraverser.cpp:61:52: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
            return getComponentOrderAttributes (a) < getComponentOrderAttributes (b);
                                                   ^
                                                   nullptr
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\tuple:759:97: note: while rewriting comparison as call to 'operator<=>' declared here      
_NODISCARD constexpr common_comparison_category_t<_Synth_three_way_result<_Types1, _Types2>...> operator<=>(
                                                                                                ^
../JUCE/modules/juce_gui_basics/components/juce_FocusTraverser.cpp:141:23: note: in instantiation of function template specialization 'juce::FocusHelpers::findAllComponents<bool (juce::Component::*)() const noexcept>' requested here
        FocusHelpers::findAllComponents (parentComponent,
                      ^
1 warning generated.

```

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [September 23, 2021, 11:43am UTC](https://forum.juce.com/t/build-warnings-on-windows-10-vs-2019/47883/2 "2021-09-23T11:43:49Z")

</div>

Do you see these warnings when building an unmodified DemoRunner project from the latest `develop` with VS2019? I’m unable to reproduce them on my machine. It looks like it’s occurring when trying to add a default spaceship operator which is a C++20 feature, have you changed the language standard?

---

<div class="post-metadata">

**Author:** ![anoesisaudio](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/anoesisaudio/32/1132_2.png) [@anoesisaudio](https://forum.juce.com/u/anoesisaudio)\
**Post date:** [September 24, 2021, 10:42pm UTC](https://forum.juce.com/t/build-warnings-on-windows-10-vs-2019/47883/3 "2021-09-24T22:42:18Z")

</div>

Hi @ed95,

It is part of CI build, so I was using cmake with ninja, setting the c++ version like `set(CMAKE_CXX_STANDARD 17)` and building with `cmake --build _builds`.

With `set(CMAKE_CXX_STANDARD 20)`, I get the same warnings.

These errors do not show when building DemoRunner with vs2019. They also do not show when building on mac or linux. I checked all three with the latest JUCE develop branch.

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [September 29, 2021, 2:06pm UTC](https://forum.juce.com/t/build-warnings-on-windows-10-vs-2019/47883/4 "2021-09-29T14:06:24Z")

</div>

I’m still not able to reproduce this. I’ve tried using the CMake Ninja generator to build the DemoRunner with the C++ standard set to both C++17 and C++20. Can you post the exact build command that you are using?

I can’t see anything wrong with that bit of code though, it looks to me like it might be a bug with MSVC’s generated spaceship operator comparing iterators.
