PC-Lint (バージョン 9.0) で受け入れられない既存の C コード (サードパーティのソース、変更できません) があります。コードは組み込み環境で実行され、Green Hills Compiler が使用されます。
コード定義を受け入れるように PC-Lint を構成する方法に関するノウハウはありますか? 構造体の最初のメンバーのエラー メッセージのみを添付しました。
ヘッダーファイルからの定義は次のとおりです。
typedef struct
{
uint32_t PINSEL0; // see ERROR message from PCLint, line 153 in LPC23.h
uint32_t PINSEL1;
uint32_t PINSEL2;
} LPC_PINCON_TypeDef;
#define LPC_PINCON_BASE (0xE002C000)
#define LPC_PINCON ((LPC_PINCON_TypeDef *) LPC_PINCON_BASE)
#define PINSEL_BASE_ADDR 0xE002C000
#define PINSEL0 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x00))
/**************************/
/* function in c-file */
void Port_Init()
{
LPC_PINCON->PINSEL0 &= ~(3 << 4); //p0.2
LPC_PINCON->PINSEL0 |= (1 << 4); //
LPC_PINCON->PINSEL0 &= ~(3 << 6); //p0.3
LPC_PINCON->PINSEL0 |= (1 << 6); //
// etc................
}
/*******************************************/
// ERRORS from PC-Lint
// **********ERROR MESSAGES**************
#... (volatile unsigned long *)(PINSEL_BASE_ADDR + 0x00))
uint32_t PINSEL0;
LPC23.h 153 Error 10: Expecting identifier
#... BASE_ADDR + 0x00))
uint32_t PINSEL0;
LPC23.h 153 Error 102: Illegal parameter specification
#... BASE_ADDR + 0x00))
uint32_t PINSEL0;
LPC23.h 153 Error 10: Expecting ';'