Google
  Web www.spinics.net

Re: buffer overflow check bug

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


On Jun 18, 2012, at 3:53 PM, Dan Carpenter wrote:

> Gar...  I have no idea.  That seems like an issue in sparse.
> 
> Does anyone know why MOD_NORETURN gets set for:
> extern void my_exit(const char*, ...) __attribute__ ((__noreturn__));
> 
> but not for:
> extern __attribute__ ((__noreturn__)) void my_exit(const char*, ...);
> 
> GCC seems to accept both formats.

Which version of sparse are you using?  Everything looks good to me here.

  extern void my_exit(const char*, ...) __attribute__ ((__noreturn__));
  extern __attribute__ ((__noreturn__)) void another_exit(const char*, ...);
  void foo(void) { my_exit(""); }
  void bar(void) { another_exit(""); }

My backend "splay" emits:

  declare void @my_exit(i8*, ...) noreturn
  declare void @another_exit(i8*, ...) noreturn
  ...

The noreturn attribute is set simply by:

  if (sym->ctype.modifiers & MOD_NORETURN)
      LLVMAddFunctionAttr(func, LLVMNoReturnAttribute);

- xi
--
To unsubscribe from this list: send the line "unsubscribe smatch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Video Projectors]     [PDAs]     [Free Online Dating]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]

Add to Google Powered by Linux