• <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>

            牽著老婆滿街逛

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

            ffmpeg 中的GNU語法

            轉(zhuǎn)載自:http://blog.chinaunix.net/uid-21564437-id-3034917.html

                閱讀ffmpeg源碼是 發(fā)現(xiàn)一些函數(shù)前面加了 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__可以設(shè)置函數(shù)屬性(Function Attribute)、變量屬性(Variable Attribute)和類型屬性(Type Attribute)。
            __attribute__語法格式為:__attribute__ ((attribute))
            需要注意的是: 使用__attribute__的時候,只能函數(shù)的聲明處使用__attribute__,并且在“;“前。

            在開發(fā)一些庫的時候,API的接口可能會過時,為了提醒開發(fā)者這個函數(shù)已經(jīng)過時。只要函數(shù)被使用,在編譯是都會產(chǎn)生警告,警告信息中包含過時接口的名稱及代碼中的引用位置。
            下面是GNU 網(wǎng)站(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

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

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


            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            久久中文字幕人妻丝袜| 精品久久一区二区三区| 人妻无码αv中文字幕久久琪琪布| 久久av免费天堂小草播放| 久久综合精品国产一区二区三区 | 色婷婷综合久久久久中文一区二区| 久久久久久久精品妇女99| 999久久久免费精品国产| 国产午夜精品久久久久九九| 人妻无码精品久久亚瑟影视| 久久99精品国产| 亚洲女久久久噜噜噜熟女| 99久久国产综合精品五月天喷水| 亚洲国产成人久久综合野外| 91亚洲国产成人久久精品网址| 2020久久精品亚洲热综合一本| 国产99久久九九精品无码| 久久水蜜桃亚洲av无码精品麻豆| 日韩精品无码久久一区二区三| 久久99精品久久久久久久久久| 思思久久99热只有频精品66| 久久久WWW免费人成精品| 国产91色综合久久免费| 亚洲av日韩精品久久久久久a| 午夜精品久久久久久| 国产精品九九久久精品女同亚洲欧美日韩综合区 | 久久久久香蕉视频| 久久青草国产手机看片福利盒子| 亚洲综合伊人久久大杳蕉| 亚洲国产成人精品女人久久久| 久久综合狠狠综合久久激情 | 久久久久久九九99精品| 色综合久久无码中文字幕| 亚洲AV无码久久精品色欲| 成人综合久久精品色婷婷| 亚洲国产成人久久一区WWW| 一极黄色视频久久网站| 久久久久久伊人高潮影院| 人人妻久久人人澡人人爽人人精品| 一级a性色生活片久久无少妇一级婬片免费放| 精品久久久久久久中文字幕|