Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index


On Wed, 2018-09-19 at 01:29 +0200, Regina Henschel wrote:
Hi all,

I had the line
assert(false, "Standard layer may not be deleted.");

But Visual Studio 2017 does not detect the syntax error. Is there 
something wrong with my environment?

No there is nothing "wrong" with your environment.  It just means that
you are building with a release (or a non-debug) configuration.  In
C/C++, assert() is not a real function but a compiler macro, which
replaces what's inside the parentheses () with something with a no-op
if you are building a release build before the compiler even gets a
chance to parse it.

You can either re-build yours with a debug configuration, or if you
just want to enable assert in a specific file only without re-building
the whole thing, then you can just insert

#undef NDEBUG

at the beginning of the file to trigger the assert calls in that file
temporarily.

Here is a longer version of this explanation:

http://www.cplusplus.com/reference/cassert/assert/

Kohei

-- 
Kohei Yoshida, LibreOffice Calc volunteer hacker

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.