Re: How to clear unused variable warnings created by static assert?

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

 



On 23 Jul 2015, at 23:40, Jeffrey Walton <noloader@xxxxxxxxx> wrote:

>> Why don't you simply use a C++ static_assert?
>> 
>> static_assert(foo==bar, "foo should have been bar");
> 
> C++ 03.
> 
> Jeff

You could try the typedef variant of the C++98 static assert and attach an attribute unused to the typedef.
See also:

http://stackoverflow.com/questions/6954284/why-prefer-template-based-static-assert-over-typedef-based-static-assert
http://stackoverflow.com/questions/386220/how-can-i-hide-defined-but-not-used-warnings-in-gcc

Cheers,
Oleg



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux