Skip to main content

IAR Embedded Workbench for Arm 9.70.x

deprecated

このセクションの内容:
構文
#pragma deprecated
説明

タイプの宣言のすぐ前に、このプラグマディレクティブを配置する場合、変数、関数、フィールド、または定数は警告になります。

このプラグマディレクティブは、C++の属性[[deprecated]]と同じ効果を持ちますが、C言語でも使用できます。

#pragma deprecated
typedef int * intp_t;  // typedef intp_t is deprecated

#pragma deprecated
extern int fun(void);  // function fun is deprecated

#pragma deprecated
struct xx {            // struct xx is deprecated
  int x;
};

struct yy {
#pragma deprecated
  int y;               // field y is deprecated
};

intp_t fun(void)       // Warning here
{
  struct xx ax;        // Warning here
  struct yy ay;
  fun();               // Warning here
  return ay.y;         // Warning here
}
関連項目

標準CのAnnex K (境界チェックインターフェース)。