• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            牽著老婆滿街逛

            嚴以律己,寬以待人. 三思而后行.
            GMail/GTalk: yanglinbo#google.com;
            MSN/Email: tx7do#yahoo.com.cn;
            QQ: 3 0 3 3 9 6 9 2 0 .

            ffmpeg 中的GNU語法

            轉載自:http://blog.chinaunix.net/uid-21564437-id-3034917.html

                閱讀ffmpeg源碼是 發現一些函數前面加了 attribute_deprecated 屬性;如:attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags);
            在libavutil/attributes.h  中有如下定義:

            #ifndef attribute_deprecated
            #if AV_GCC_VERSION_AT_LEAST(3,1)
            #    define attribute_deprecated __attribute__((deprecated))
            #else
            #    define attribute_deprecated
            #endif
            #endif

            __attribute__ 語法為GNU C 的特性,__attribute__可以設置函數屬性(Function Attribute)、變量屬性(Variable Attribute)和類型屬性(Type Attribute)。
            __attribute__語法格式為:__attribute__ ((attribute))
            需要注意的是: 使用__attribute__的時候,只能函數的聲明處使用__attribute__,并且在“;“前。

            在開發一些庫的時候,API的接口可能會過時,為了提醒開發者這個函數已經過時。只要函數被使用,在編譯是都會產生警告,警告信息中包含過時接口的名稱及代碼中的引用位置。
            下面是GNU 網站(http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Function-Attributes.html)上對這個屬性的解釋:
            deprecated
            The deprecated attribute results in a warning if the function is used anywhere in the source file. This is useful when identifying functions that are expected to be removed in a future version of a program. The warning also includes the location of the declaration of the deprecated function, to enable users to easily find further information about why the function is deprecated, or what they should do instead. Note that the warnings only occurs for uses:
                      int old_fn () __attribute__ ((deprecated));
                      int old_fn ();
                      int (*fn_ptr)() = old_fn;
                
            results in a warning on line 3 but not line 2.
            下面是一個列子:
            root@wang:/work/wanghuan/gnu# cat gnu.c

            #include <stdlib.h>
            #include 
            <stdio.h>

            __attribute__((deprecated)) 
            void attribute();
            void attribute()
            {
             printf(
            "GNU attribute \n");
            }


            int main()
            {
             attribute();
             
            return 0;
            }

            root@wang:/work/wanghuan/gnu# gcc gnu.c -o gnu
            gnu.c: In function ‘main’:
            gnu.c:12: warning: ‘attribute’ is deprecated (declared at gnu.c:5)     //編譯警告
            root@wang:/work/wanghuan/gnu# ./gnu
            GNU attribute

            關于__attribute__屬性,有多種類型,由于ARM編譯器支持GNU語法,在ARM的網站http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0348bc/Caccahah.html 有這些特性的詳細介紹。

            posted on 2013-01-29 16:05 楊粼波 閱讀(796) 評論(0)  編輯 收藏 引用

            色综合久久久久综合体桃花网| 亚洲天堂久久精品| 久久中文字幕精品| 亚洲av成人无码久久精品| MM131亚洲国产美女久久| 大蕉久久伊人中文字幕| 久久人妻少妇嫩草AV蜜桃| 久久久久成人精品无码中文字幕 | 国产精品一区二区久久国产 | 欧美一区二区久久精品| 久久久久亚洲AV无码麻豆| 亚洲国产成人精品91久久久| 国内精品久久久久久99蜜桃| 亚洲国产综合久久天堂| 久久www免费人成精品香蕉| 欧美熟妇另类久久久久久不卡 | 欧美喷潮久久久XXXXx| 久久综合亚洲色HEZYO国产| 久久精品国产亚洲综合色| 日韩欧美亚洲综合久久| 久久成人国产精品一区二区| 狠狠色婷婷久久一区二区三区| 久久天天躁狠狠躁夜夜2020一| 久久久精品国产亚洲成人满18免费网站 | 亚洲色大成网站www久久九| 日韩久久久久中文字幕人妻| 66精品综合久久久久久久| 一本久久a久久精品vr综合| 久久狠狠爱亚洲综合影院| 日本久久中文字幕| 久久中文字幕人妻熟av女| 无码8090精品久久一区| 久久久久亚洲av成人无码电影| 国产精品成人精品久久久| 国产福利电影一区二区三区久久久久成人精品综合 | 欧美黑人激情性久久| 国产69精品久久久久9999APGF| 欧美日韩精品久久免费| 色天使久久综合网天天| 国产色综合久久无码有码| 99久久精品国产一区二区 |