c++之__attribute__((unused))


轉自https://blog.csdn.net/u013083059/article/details/19342935

內核時注意到有些函數會有添加__attribute__((unused)),
在gcc手冊中找到了有關的解釋:
unused:This attribute, attached to a function, means that the function is meant to be
        possibly unused. GCC will not produce a warning for this function.
===============================================================================
used: This attribute, attached to a function, means that code must be emitted for the
       function even if it appears that the function is not referenced. This is useful,
       for example, when the function is referenced only in inline assembly.

表示該函數或變量可能不使用,這個屬性可以避免編譯器產生警告信息。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM