C++ Logo


Advanced search

Re: [isocpp-ext] namespace composition

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Sun, 30 Apr 2023 16:15:40 +0000
Ideally, students should be taught practices they can deploy in production setting. While sanitizers and fuzzers have become accepted elements of the dev toolbox, they can't be deployed in production. That is part of why it is critical that we have a standard mechanism for turning bound checking on - or better yet, have bound checking on by default and have mechanism to opt out, after profiling data have shown that's what is needed.

-- Gaby

From: SG20 <sg20-bounces_at_[hidden]> on behalf of Marc Glisse via SG20 <sg20_at_[hidden]>
Sent: Sunday, April 30, 2023 9:02:29 AM
To: Ville Voutilainen via Ext <ext_at_[hidden]>
Cc: Marc Glisse <marc.glisse_at_[hidden]>; sg20_at_[hidden] <sg20_at_[hidden]>
Subject: Re: [SG20] [isocpp-ext] namespace composition

On Sun, 30 Apr 2023, Ville Voutilainen via Ext wrote:

> On Sun, 30 Apr 2023 at 04:47, Amir Kirsh via SG20 <sg20_at_[hidden]> wrote:
>> I agree with Yehezkel that introducing address sanitizer as their guard is important.
>> As they may get index out of bounds also using std::array or C-Style arrays for example.
> Well.. introducing address sanitizer to newcomers is perhaps a
> distraction and a digression.

How is learning to use the compiler correctly a distraction? Is learning
to use a debugger also a distraction? Teaching students to use some kind
of debug mode while developing can save a lot of time (so can enabling
warnings). And it doesn't need to be perfect to be helpful.

AFAIK all implementations provide options to check out-of-bound vector
access. For gcc, it could be -D_GLIBCXX_DEBUG, or the lighter
(the extra define is necessary to catch Amir's example).

Marc Glisse
SG20 mailing list

Received on 2023-04-30 16:15:44