Re: [PATCH v3 5/6] x86/ftrace: Use text_poke()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Wed, Jan 22 2020, Josh Poimboeuf wrote:
> Global noreturns are already a pain today.  There's no way for objtool
> to know whether GCC considered a function to be noreturn,

You should be able to get a good idea with -Wsuggest-attribute=noreturn:

$ cat a.c
int __attribute__((noreturn)) my_abort (void)
{
  __builtin_abort ();
}

int foo (void)
{
  return my_abort ();
}

int bar (int flag)
{
  if (flag)
    foo ();
  return 4;
}

$ gcc -S -O2 -Wsuggest-attribute=noreturn a.c 
a.c: In function ‘foo’:
a.c:6:5: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn]
    6 | int foo (void)
      |     ^~~

GCC 9 and newer even have -fdiagnostics-format=json if you are into that
kind of thing.

Hope this helps a little,

Martin




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux