C++ Logo

sg15

Advanced search

Re: [isocpp-sg15] [isocpp-sg21] P3835 -- Different contract checking for different libraries

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Tue, 14 Oct 2025 14:49:04 +0000
How to use the hardened standard library?

-- Gaby



________________________________
From: SG15 <sg15-bounces_at_[hidden]> on behalf of René Ferdinand Rivera Morell via SG15 <sg15_at_[hidden]>
Sent: Tuesday, October 14, 2025 9:58:48 AM
To: sg21_at_[hidden] <sg21_at_[hidden]>; ISO C++ Tooling Study Group <sg15_at_[hidden]>
Cc: René Ferdinand Rivera Morell <grafikrobot_at_[hidden]>
Subject: Re: [isocpp-sg15] [isocpp-sg21] P3835 -- Different contract checking for different libraries

On Tue, Oct 14, 2025 at 8:34 AM JOSE DANIEL GARCIA SANCHEZ via SG21 <sg21_at_[hidden]<mailto:sg21_at_[hidden]>> wrote:
Knowing that a feature like "labels" is coming, I am happy with the
status quo for C++26, but we probably won't enable C++26 contracts for
anything that targets mixed contexts until we get labels. YMMV.

This means that you need a flag like -fno-contracts. Keep in mind that you will get preconditions/postconditions in certain functions from the standard library.

It's almost certain you'll get that flag from compiler vendors. And very likely other flags with finer control.

--
-- René Ferdinand Rivera Morell
-- Don't Assume Anything -- No Supongas Nada
-- Robot Dreams - http://robot-dreams.net<http://robot-dreams.net/>

Received on 2025-10-14 14:49:12