額面どおりに解釈すると、このエラー メッセージは、ファイルの 95 行目../Indication.c
(説明したファイルと同じファイルである場合もそうでない場合もあります) に、次のようindication.c
な静的宣言があることを意味します。menu_boot
static unsigned char menu_boot(unsigned char index, unsigned char *menu1);
または、次のような静的定義:
static unsigned char menu_boot(unsigned char index, unsigned char *menu1)
{
...
}
ファイル内の次のコードを検討してくださいxx.c
。
extern unsigned char function(int abc);
static unsigned char function(int abc);
static unsigned char function(int abc)
{
return abc & 0xFF;
}
GCC 4.1.2 (RHEL 5 上) でコンパイルすると、コンパイラは次のように表示します。
$ gcc -c xx.c
xx.c:3: error: static declaration of ‘function’ follows non-static declaration
xx.c:1: error: previous declaration of ‘function’ was here
$
3 行目をコメントアウトすると、コンパイラは次のように言います。
$ gcc -c xx.c
xx.c:6: error: static declaration of ‘function’ follows non-static declaration
xx.c:1: error: previous declaration of ‘function’ was here
$
メッセージは同じですが、以前の宣言があった場所に関する情報が含まれています。この場合、同じソース ファイルにあります。宣言が翻訳単位に含まれる別のソース ファイル (通常はヘッダー) にある場合、その別のファイルを識別します。