This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [WIP PATCH] add object access attributes (PR 83859)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 30 Sep 2019 21:34:36 +0000
- Subject: Re: [WIP PATCH] add object access attributes (PR 83859)
- Ironport-sdr: /Rxn3VJapNJCAqIlwKW44R0KUgblTcBgCYXgLd6M1cMR2EPVmkYybSfjzVoSGb8q5QZ/hWCtym pj1tIdR3MifiKqc2cINGPj0q0Svg9XPxqYYL06llRFhKnePyoDvvlyeZvLRa/oyLnJwZ6ooGg7 cMSTI9sNikDNCrkGhhHLui2szqfa5oxZesLYTIO7ezVU8MjGlVf6CjcyTB6zeAWvh3NVd6CfAl Yi822CrMt2LigO3HFEN6MyGgsAbnKB+Kw6Zi5AI2yRMbnQ96xzprKYMyvFsYc3dxJVKHfv2kPP 2+o=
- Ironport-sdr: ePJZaNJitPcL+0uBC1Qq5PXMReTqc+zUIQZvlV4IDrtCN7KU+jZr0Xu4FriIltjnWlvTKd7U7l o9Lpp6obUnlNa8BFD7UdulPtKABBPQwxNEoDGwka1z/+Am8YLUJoQYCofs0kt9YiAjc6LuKCAx 2vDZcZQMTLzblUF/RrUSvBEqZMzuHfnHSXVt55q8jhdAAWAmgwWCI/yXeAVf7+5w1CnlqeM51V 5BEYIecKwkINVUvGd6gu2gS5SheEnENOUiPpfAtZ0DQetzoLFlWqV2Sg+FCKLkLJgP1wDCrPI8 q84=
- References: <056e2b5b-696c-ca69-9027-7d2369354b07@gmail.com>
On Sun, 29 Sep 2019, Martin Sebor wrote:
> PR 83859 asks to expose the same checking that GCC does natively for
> built-in calls via a function attribute that associates a pointer
> argument with the size argument, such as:
I'll also note that, as mentioned in that bug (but more specifically
covered by the separate bug 50584) it would make sense to have similar
warnings with [static] parameter array declarators. And that the C2x
charter includes a principle that new interfaces should have the array
size before the array parameter to allow parameters to be declared using
VLA syntax like that, so it's plausible the [static] case will be useful
for more functions in future (although it's up to library implementations
exactly what form they use in their headers, given they have other
considerations such as C++ compatibility).
Hopefully the infrastructure in this patch will facilitate future support
for such diagnostics in the [static] case.
--
Joseph S. Myers
joseph@codesourcery.com