Suppress Compiler warning Function declared never referenced

前端 未结 9 777
你的背包
你的背包 2020-12-30 01:51

So i have some code like this:

void foo (int, int);

void bar ( )
{
    //Do Stuff

   #if (IMPORTANT == 1)
       foo (1, 2);
   #endif

}

9条回答
  •  清歌不尽
    2020-12-30 02:02

    For ARM target platform while using, ARM compiler, Use the following compiler directive around the target function to suppress "Warning[Pe177]: function declared but never referenced" warning messages:

    #pragma diag_suppress=Pe177
    void foo(void)
    {
    /* does something but is not being called for the current build */
    }
    

提交回复
热议问题