From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6B9023851ABB; Wed, 8 Mar 2023 17:38:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B9023851ABB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678297129; bh=RMKZgUOSaqR9DND218A2Gh97AGypsct0b0JIJ2vj0qE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=T9frz5VUxVB7iz69D3l6XsqHxAc9VQpPnn3PkPH7m9pEF5CJsl5tSRvxHo7rNqKsR Q2gsSjg3P2FrC66/RA9upl2Iigp10A4EfsYglNvnF9+MeiHk3cnrmZffQ/ZPGHR5Ci 7tSZkRtLx0RwrbMiPkfg3yxvRSW2sy1ynqaaCdTo= From: "qinzhao at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108896] provide "element_count" attribute to give more context to __builtin_dynamic_object_size() and -fsanitize=bounds Date: Wed, 08 Mar 2023 17:38:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: qinzhao at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: qinzhao at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108896 --- Comment #26 from qinzhao at gcc dot gnu.org --- (In reply to Martin Uecker from comment #20) >=20 > I agree. An attribute is simple and extending C will take > more care (and work). >=20 > The reason I think we should also extend C (together with > WG14) is because this would allow writing code where the > bound is never lost because it is encoded in the type, > while the=C2=A0 __builtin_dynamic_object_size is extremely > useful to enhance existing code bases, but is best > effort only. >=20 > So I think we should do both. >=20 Agreed.=