From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id 433C738582AD for ; Thu, 23 Jun 2022 22:01:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 433C738582AD Received: by mail-ej1-x631.google.com with SMTP id sb34so911085ejc.11 for ; Thu, 23 Jun 2022 15:01:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to; bh=0hdvExuRId62S1jIr/xW9oIKd7/nBbiLQ3KrYtaIcxY=; b=Azy2TtfiBOG6BYouv1HTURFWbOVQUM5f0mvrjb238IdInkRulFEv5E6ADBfC/Chz79 T3PYdszwuzfNcikvfvbQScOpvK3F/S+4lRCyJzFItwoQyHDPVq+Kl0K3vrasfHDMA4iL gVRVPLv+bzCOconsVoK7kg8O7Um3m817i7XJRorGGTfYeDAlAYzDU1XyNkv8tGQV/DfI XSrIddhSyATfYdc1Qhf4FKribWSZvOxhuPjAsYNw+m3flFK6JGdgJNE85bpz0ve2fL5g Ig9CvEuTxXnIjO2QGSTPo+wlAD9t5D3gl79M8Yy1wz8kP/wUyDywhLvkKuUaLly7LK2w +rtA== X-Gm-Message-State: AJIora8DWgSoC8WHXF2hTODJvUvFiv+7Uj7yXXLn2ghpcrkOB9no5usY p9XmtVCy0gksy+J+nnJI5jgPsDgclAHuJPC4PRzceZQmLE4= X-Google-Smtp-Source: AGRyM1ty9qWygqrqZYmeYM5t/qWrJz+CTH2zS+Pr5dKx4neGPyfzUJvalWpZuq6XCuPed0W0vuzscoyu5uqKOKLd2j4= X-Received: by 2002:a17:906:dc8f:b0:723:a62a:cd0e with SMTP id cs15-20020a170906dc8f00b00723a62acd0emr6139189ejc.444.1656021679975; Thu, 23 Jun 2022 15:01:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: cauldwell.thomas@gmail.com From: Frederick Virchanza Gotham Date: Thu, 23 Jun 2022 23:01:09 +0100 Message-ID: Subject: Re: string::iterator should have more error checking To: "libstdc++" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2022 22:01:22 -0000 On Thu, Jun 23, 2022 at 10:26 PM Jonathan Wakely wrote: > AddressSanitizer does give an error for your example though. If you're talking about using "g++" with the command line option "-fsanitize=address", well I've tested it and it **doesn't** give an error for my sample program. I thought that "-D_GLIBCXX_DEBUG" would make it use "__gnu_debug::string". So are you saying that I'll have to do the following in my code? #ifdef NDEBUG #include typedef std::string string; #else #include typedef __gnu_debug::string string; #endif Is this what I'm supposed to do?