Re: [PATCH v3 14/24] AArch64: Implement the memory tagging gdbarch hooks

Simon Marchi via Gdb-patches
2021-01-18T16:29:26Z

>>> +      if (g < n)
>>> +    {
>>> +      warning (_("Got more tags than memory granules.  Tags will be "
>>> +             "truncated."));
>>> +    }
>>
>> Remove curly braces.
>>
>
> Isn't the rule to have curly braces for one-statement conditionals if such statement spans more than a single line? That has been my understanding so far.

I don't really know for sure, the GNU coding style is kinda vague. But
if you find it let me know.

My understanding (and I don't really know where I took this) was to apply
this rule when you have a comment:

if (something)
/* Something. */
something ();

vs

if (something)
{
/* Something. */
something ();
}

The situation where it's really important, that the GNU coding standard
talks about, is a if-else inside an if:

if (foo)
if (bar)
win ();
else
lose ();

vs

if (foo)
{
if (bar)
win ();
else
lose ();
}

It would be easy to get confused with the first one. But all the other
ones are not a big deal.

Simon