GNU attributes with C++11 syntax

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

 



GCC 4.9 gives a warning for this program:

int main()
{
    int x;
}

test.cpp: In function 'int main()':
test.cpp:3:9: warning: unused variable 'x' [-Wunused-variable]
     int x;
         ^

If I add an "unused" attribute with the GNU syntax:

    int x __attribute__((unused));

the warning goes away.

However, if I use the C++11 syntax:

    int x [[unused]];

the warning remains, and I also get:

test.cpp:3:20: warning: 'unused' attribute directive ignored [-Wattributes]
     int x [[unused]];
                    ^

Are there plans to support the attributes with C++11 syntax
(in terms of having them actually do something)?

Thanks,
Nate
 		 	   		  




[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