Windows 上の PIC32 (XC32 v1.40 コンパイラ) で MPLAB X (3.26) を使用しています。レビューの一環として、誰かのコードの静的コード分析を行うためにスプリントを使用しようとしています。コンパイラの定義と検索パスのほとんどを並べ替えましたが、PIC32 std インクルード ファイルの解析エラーを回避するには少し困惑しています。
スプリントを実行するために使用しているコマンドは
splint ^
-D"__32MX370F512L__" ^
-D"__PIC32_FEATURE_SET__"=370 ^
-D"__LANGUAGE_C__" ^
+I"C:/Program Files (x86)/Microchip/xc32/v1.40/pic32mx/include/" ^
main.c
出力は次のようになります
< Location unknown >: Field name reused:
Code cannot be parsed. For help on parse errors, see splint -help
parseerrors. (Use -syntax to inhibit warning)
< Location unknown >: Previous use of
< Location unknown >: Previous use of
.... approx 100 times then...
C:\Program Files (x86)\Microchip\xc32\v1.40\pic32mx\include\\stddef.h(4,18):
Datatype ptrdiff_t declared with inconsistent type: long int
A function, variable or constant is redefined with a different type. (Use
-incondefs to inhibit warning)
load file standard.lcd: Specification of ptrdiff_t: arbitrary integral type
C:\Program Files (x86)\Microchip\xc32\v1.40\pic32mx\include\\stddef.h(5,27):
Datatype size_t declared with inconsistent type: unsigned long int
load file standard.lcd: Specification of size_t:
arbitrary unsigned integral type
C:\Program Files (x86)\Microchip\xc32\v1.40\pic32mx\include\\stddef.h(6,13):
Datatype wchar_t declared with inconsistent type: int
load file standard.lcd: Specification of wchar_t: arbitrary integral type
C:\Program Files (x86)\Microchip\xc32\v1.40\pic32mx\include\\stdarg.h(75,36):
No type before declaration name (implicit int type): __builtin_va_list :
int
A variable declaration has no explicit type. The type is implicitly int.
(Use -imptype to inhibit warning)
C:\Program Files (x86)\Microchip\xc32\v1.40\pic32mx\include\\stdarg.h(75,36):
Parse Error: Suspect missing struct or union keyword: __builtin_va_list :
int. (For help on parse errors, see splint -help parseerrors.)
*** Cannot continue.
最後の 1 つは、物事を停止させます。-skip-iso-headers のようなことを試しましたが、うまくいきませんでした。standard.lcd ファイルと xc32 std ファイルに問題があるようです。
誰か教えてくれませんか
< Location unknown >: Field name reused:
手段またはおそらく言及しているものは何ですか?- std ヘッダー ファイルによる解析エラーを解決する方法はありますか?
これまでのところ、ヘッダー ファイルの問題を解決する唯一の方法は、型を定義することです。
-D"__builtin_va_list"=int ^