コードは Debian 5 システムではエラーなしでコンパイルされますが、FreeBSD 7 ではたとえば 98 行目で構文エラーが発生するため、これは非常に不可解です。
int ipmi_fru_get_board_info_mfg_time(ipmi_fru_t *fru, time_t *time);
元々、*fru と time_t の間には改行がありました。これらのコンパイラ エラーの原因は不明ですが、改行について言及することは重要だと感じました。
または、これは 298 行目で、形式がまったく変更されていません。
int ipmi_fru_get(ipmi_fru_t *fru,
int index,
char **name,
int *num,
enum ipmi_fru_data_type_e *dtype,
int *intval,
time_t *time,
char **data,
unsigned int *data_len);
これらは、端末に出力される変更されていないエラーです。
In file included from out_fru.c:37:
../include/OpenIPMI/ipmi_fru.h:98: error: expected declaration specifiers or '...' before 'time_t'
../include/OpenIPMI/ipmi_fru.h:298: error: expected declaration specifiers or '...' before 'time_t'
../include/OpenIPMI/ipmi_fru.h:474: error: expected declaration specifiers or '...' before 'time_t'
../include/OpenIPMI/ipmi_fru.h:559: error: expected declaration specifiers or '...' before 'time_t'
../include/OpenIPMI/ipmi_fru.h:627: error: expected declaration specifiers or '...' before 'time_t'
後続のエラーは、ipmi_fru.h ヘッダー ファイルの上記の行で宣言された関数に影響するため、関連しているようです。
out_fru.c: In function 'ipmi_cmdlang_dump_fru_info':
out_fru.c:87: warning: passing argument 7 of 'ipmi_fru_get' from incompatible pointer type
out_fru.c:87: warning: passing argument 8 of 'ipmi_fru_get' from incompatible pointer type
out_fru.c:87: error: too many arguments to function 'ipmi_fru_get'
これらの奇妙なプラットフォーム固有の構文エラーの原因は何ですか? 私の最初の考えは印刷できない文字でしたが、 cat -e include/OpenIPMI/ipmi_fru.h | で確認してみました。以下、スペースと改行だけが表示されます。