This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][ARM] Add support for "noinit" attribute


On Tue, Jul 02, 2019 at 05:01:33PM +0200, Christophe Lyon wrote:
> On Mon, 1 Jul 2019 at 17:58, Kyrill Tkachov <kyrylo.tkachov@foss.arm.com> wrote:
> > +static tree
> > +arm_data_attr (tree * node,
> > +                 tree   name,
> > +                 tree   args ATTRIBUTE_UNUSED,
> > +                 int    flags ATTRIBUTE_UNUSED,
> > +                 bool * no_add_attrs ATTRIBUTE_UNUSED)
> > +{
> >
> > no_add_attrs is set in this function, so should not be ATTRIBUTE_UNUSED?
> Right! Guess what? There's the same mistake in msp430.c :-)

This attribute means that parameter is *possibly* unused.  It doesn't have
to be.

Now that we have C++ you could write this as

static tree
arm_data_attr (tree *node, tree name, tree /*args*/, int /*flags*/,
               bool */*no_add_attrs*/)
{

(or leave the names completely away where that makes sense), and then
the parameter *has* to be unused (you *cannot* refer to it ;-) )


Segher


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]