[PATCH] Fix -Wmisleading-indentation warning in top.c

Pedro Alves palves@redhat.com
Wed Dec 18 17:10:00 GMT 2019


On 12/18/19 4:42 PM, Pedro Alves wrote:

> Sounds like GCC should catch this too.

It looks like it's the continuation line that prevents it.  Here's
a minimal reproducer:

void print (const char *);

void function1 (void)
{
  if (1)
    print ("\n");
    print ("\n"); // warns
}

void function2 (void)
{
  if (1)
    print ("hello\
\n");
    print ("\n"); // does not warn
}

I'll file a bug.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list