- unused variable

  int foo(void)

  {

    int i __attribute__((unused));

    return 0;

  }


- unused function

   static int foor(void) __attribute__((unused));

   static int foo(void)

  {

    int i;

    return 0;

  }


- unused label


  #define HAVE_CHECK


  int foo(int mode)

  {

    #ifdef HAVE_TYPE

      if (mode == TYPE) goto LABEL_TYPE;

    #endif


    #ifdef HAVE_CHECK

      if (mode == CHECK) goto LABEL_CHECK;

    #endif


 LABEL_TYPE:

 __attribute__((cold, unused));

    return 0;


LABEL_CHECK:

 __attribute__((cold, unused));

    return -1;


    return 0;

  }

'development' 카테고리의 다른 글

How to install ubuntu to rangeley  (1) 2016.01.21
[gcc] -march, -mtune 옵션  (0) 2016.01.08
openwrt  (0) 2015.02.24
[network] nat 설정법  (0) 2015.01.15
[linux] debug fs 사용법  (0) 2015.01.07
블로그 이미지

김유석0

,