On Monday 26 August 2024 13:12:55 GMT-7 Thiago Macieira wrote:
> "Q_ASSERT don't affect noexceptness"
> 
> Or
> 
> "noexcept(false) if you call other, noexcept(false) functions from your
> code", which includes all the pthread cancellation points in glibc. Since
> qt_assert is noexcept, Q_ASSERT is not included. This is very easy to
> implement with a static checker.
> 
> We could be more complex, with "Q_ASSERT that check preconditions imply
> noexcept(false) but Q_ASSERT that verify the state of the internal invariant
> against corruption don't". This would not be easy to implement with a
> static checker.

What is the rule for dereferencing pointers?

Imagine a function that does:
  Q_ASSERT(d);
  d->i = b;

is that noexcept? Or is that a precondition?

What happens if I delete the Q_ASSERT? Obviously they aren't necessary, 
because they already do disappear on release mode.

On Windows, crashes are delivered as Structured Exceptions, which someone 
could convert in to C++ exceptions. So is any function that dereferences a 
pointer using a narrow contract?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Platform & System Engineering

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to