quality of visual studio 2017 compiler?

DSP, Plug-in and Host development discussion.
Miles1981
KVRian
1373 posts since 26 Apr, 2004 from UK

Post Tue Jan 15, 2019 9:30 am

stratum wrote:
Tue Jan 15, 2019 3:21 am
And Miles hates C mixed with C++. Perhaps we should tell that to open source community, but that wouldn't be at the top of my list of requests.
A simple PR to fix this nowadays.
stratum wrote:
Tue Jan 15, 2019 3:21 am
edit. Looks like it's about 1000K lines of c/c++ code (excluding open source dependencies) now and there is a memory bug somewhere that doesn't get revealed in debug builds (or in release builds without optimization).
You may want to build your application with clang and turn on address sanitizer then. If it is a memory bug, it will find it.

stratum
KVRAF
2199 posts since 29 May, 2012

Re: quality of visual studio 2017 compiler?

Post Tue Jan 15, 2019 9:57 am

Miles1981 wrote:
Tue Jan 15, 2019 9:30 am
stratum wrote:
Tue Jan 15, 2019 3:21 am
And Miles hates C mixed with C++. Perhaps we should tell that to open source community, but that wouldn't be at the top of my list of requests.
A simple PR to fix this nowadays.
Typing std::abs would be trivial, but not really very useful when the application happens to have dependencies written in C.
You may want to build your application with clang and turn on address sanitizer then. If it is a memory bug, it will find it.
That's approximately a two weeks long job (compiling all the open source the dependencies usually takes about 1-2 weeks, that is, if possible at all, because people usually assume that you use a specific compiler on a specific platform. i.e. Visual Studio on Windows, GCC on Linux, etc, and most open source software is never tested with Clang. GCC has that address sanitizer too, but it's necessary to recompile everything including every dependency. That's why it's not usable. Even if we assume that everything would be compatible with the address sanitizer mode (pretty unlikely) editing every make/cmake/who knows what compile script out there to include the address sanitizer is not practical at all.
~stratum~

Miles1981
KVRian
1373 posts since 26 Apr, 2004 from UK

Re: quality of visual studio 2017 compiler?

Post Wed Jan 16, 2019 3:04 am

You don't have to compile your third party libraries with address sanitizer. I don't.

stratum
KVRAF
2199 posts since 29 May, 2012

Re: quality of visual studio 2017 compiler?

Post Wed Jan 16, 2019 3:05 am

Miles1981 wrote:
Wed Jan 16, 2019 3:04 am
You don't have to compile your third party libraries with address sanitizer. I don't.
So it worked that way with CLang? With GCC it does not.
I'll give it a try.
~stratum~

Miles1981
KVRian
1373 posts since 26 Apr, 2004 from UK

Re: quality of visual studio 2017 compiler?

Post Wed Jan 16, 2019 3:13 am

If, it does really well. Of course, that means that what is allocated in the library but delete in your app is flagged, but that's normal. Never had an issue with gcc for that either, and it did manage to find some errors in user code.

stratum
KVRAF
2199 posts since 29 May, 2012

Re: quality of visual studio 2017 compiler?

Post Wed Jan 16, 2019 3:15 am

GCC is very picky about compiler flags to be consistent accross the whole source code. I don't really recall what had happened but it didn't really work. It may also be a limitation of a specific version of GCC (4.8 series).
~stratum~

stratum
KVRAF
2199 posts since 29 May, 2012

Re: quality of visual studio 2017 compiler?

Post Wed Jan 16, 2019 4:18 am

Failed cause Boost & CLang do not like each other much on Windows because of this : https://github.com/boostorg/thread/issues/139 and if BOOST_USE_WINDOWS_H is defined as recommended compile errors are eliminated but there are link errors, meaning Boost need to be recompiled with that flag, and that was the first module of the application which had the least amount of dependencies. I wonder what would happen when others are included.

edit: This is what BOOST_USE_WINDOWS_H apparently prevents which is Boost team having their own versions of Windows API functions declared inside Boost! https://anteru.net/blog/2009/02/09/364/index.html
~stratum~

Return to “DSP and Plug-in Development”