This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: [PATCH] Add warn_if_not_aligned attribute
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Martin Sebor <msebor at gmail dot com>, Jason Merrill <jason at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 17 Aug 2017 13:52:13 +0000
- Subject: Re: RFC: [PATCH] Add warn_if_not_aligned attribute
- Authentication-results: sourceware.org; auth=none
- References: <6c6c268d-a40b-cfa9-574c-ad235f9205b7@gmail.com> <CAMe9rOqR6w+vy+3d045cACetg9ZW706naBD-FtVdCOmgj+Dv-g@mail.gmail.com> <CAMe9rOo0WL+1rJQ_3EMdi2wJq-KJ4YWmTmGodeoVZ5e10vV-pA@mail.gmail.com> <4a4ac20f-9c27-4844-55dc-38ff56ac138b@gmail.com> <CAMe9rOryx5NH9Tp6Y26f=h5pWPeg9kNyOBxuhTjT=aOJxvDYcA@mail.gmail.com> <ea1100d5-fe57-fe31-134c-6dcf94289437@gmail.com> <CAMe9rOp-X1S_HY70hr_-CO2HDvsDAJEw1FTMEj+CKS5Ds7C8-A@mail.gmail.com> <alpine.DEB.2.20.1706151728020.3768@digraph.polyomino.org.uk> <20170616115455.GA3457@gmail.com> <alpine.DEB.2.20.1707061537330.7309@digraph.polyomino.org.uk> <20170708134504.GA1303@gmail.com>
On Sat, 8 Jul 2017, H.J. Lu wrote:
> +@item -Wpacked-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
> +@opindex Wpacked-not-aligned
> +@opindex Wno-packed-not-aligned
> +Warn if a structure field with explicitly specified alignment in a
> +packed struct or union is misaligned. For example, a warning will
> +be issued on @code{struct S}, like, @code{warning: alignment 1 of
> +'struct S' is less than 8}, in this code:
Use @samp for warnings quoted in the manual, as previously discussed.
OK with that change, in the absence of C++ maintainer objections within 48
hours.
--
Joseph S. Myers
joseph@codesourcery.com