轉自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.
表示該函數或變量可能不使用,這個屬性可以避免編譯器產生警告信息。
在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.
表示該函數或變量可能不使用,這個屬性可以避免編譯器產生警告信息。