前一次编译还没有错误,做了一些改动后就编译出错。 以前还出现过很多次类似的情况。
void Delay_Init(void);
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(352): error: #20: identifier "size_t" is undefined
int /*mode*/, size_t /*size*/) __attribute__((__nonnull__(1)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(435): error: #20: identifier "size_t" is undefined
extern _ARMABI int __ARM_snprintf(char * __restrict /*s*/, size_t /*n*/,
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(440): error: #20: identifier "size_t" is undefined
extern _ARMABI int snprintf(char * __restrict /*s*/, size_t /*n*/,
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(461): error: #20: identifier "size_t" is undefined
extern _ARMABI int _snprintf(char * __restrict /*s*/, size_t /*n*/,
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(551): error: #20: identifier "__va_list" is undefined
extern _ARMABI int vfscanf(FILE * __restrict /*stream*/, const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1,2)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(552): error: #20: identifier "__va_list" is undefined
extern _ARMABI int vscanf(const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(553): error: #20: identifier "__va_list" is undefined
extern _ARMABI int vsscanf(const char * __restrict /*s*/, const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1,2)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(555): error: #20: identifier "__va_list" is undefined
extern _ARMABI int _vfscanf(FILE * __restrict /*stream*/, const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1,2)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(556): error: #20: identifier "__va_list" is undefined
extern _ARMABI int _vscanf(const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(557): error: #20: identifier "__va_list" is undefined
extern _ARMABI int _vsscanf(const char * __restrict /*s*/, const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1,2)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(558): error: #20: identifier "__va_list" is undefined
extern _ARMABI int __ARM_vsscanf(const char * __restrict /*s*/, const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1,2)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(560): error: #20: identifier "__va_list" is undefined
extern _ARMABI int vprintf(const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(568): error: #20: identifier "__va_list" is undefined
extern _ARMABI int _vprintf(const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(575): error: #20: identifier "__va_list" is undefined
const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1,2)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(585): error: #20: identifier "__va_list" is undefined
const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1,2)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(594): error: #20: identifier "size_t" is undefined
extern _ARMABI int __ARM_vsnprintf(char * __restrict /*s*/, size_t /*n*/,
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(595): error: #20: identifier "__va_list" is undefined
const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(3)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(597): error: #20: identifier "size_t" is undefined
extern _ARMABI int vsnprintf(char * __restrict /*s*/, size_t /*n*/,
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(598): error: #20: identifier "__va_list" is undefined
const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(3)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(610): error: #20: identifier "__va_list" is undefined
const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1,2)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(617): error: #20: identifier "__va_list" is undefined
const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1,2)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(623): error: #20: identifier "size_t" is undefined
extern _ARMABI int _vsnprintf(char * __restrict /*s*/, size_t /*n*/,
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(624): error: #20: identifier "__va_list" is undefined
const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(3)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(633): error: #20: identifier "__va_list" is undefined
extern _ARMABI int vasprintf(char ** /*strp*/, const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(2)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(637): error: #20: identifier "__va_list" is undefined
extern _ARMABI int __ARM_vasprintf(char ** /*strp*/, const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(2)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(778): error: #20: identifier "size_t" is undefined
extern _ARMABI size_t fread(void * __restrict /*ptr*/,
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(779): error: #20: identifier "size_t" is undefined
size_t /*size*/, size_t /*nmemb*/, FILE * __restrict /*stream*/) __attribute__((__nonnull__(1,4)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(779): error: #20: identifier "size_t" is undefined
size_t /*size*/, size_t /*nmemb*/, FILE * __restrict /*stream*/) __attribute__((__nonnull__(1,4)));
C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h(794): error: #20: identifier "size_t" is undefined
extern _ARMABI size_t __fread_bytes_avail(void * __restrict /*ptr*/,
..\FML\src\f_usart_protocol.c: 1 warning, 30 errors
compiling a_device_check.c...
..\APL\inc\insufflator-type.h(49): warning: #1-D: last line of file ends without a newline
#endif /* _INSUFFLATOR_TYPE_H_ */
..\Hal\Inc\h_watchdog.h(25): warning: #1-D: last line of file ends without a newline
..\APL\inc\filter.h(12): error: #130: expected a "{"
float FirstOrder_LowPassFilter(float now, float filterCoefficient);
..\APL\inc\unit-converter.h(23): warning: #12-D: parsing restarts here after previous syntax error
{
..\APL\inc\unit-converter.h(24): error: #118: a void function may not return a value
return (val * 51.723);
..\APL\inc\unit-converter.h(24): error: #20: identifier "val" is undefined
return (val * 51.723);
..\APL\src\a_device_check.c(113): warning: #111-D: statement is unreachable
总结发现,这种错误出现的共同点: 某个头文件语法有错误
这次出现这种错误的原因就是某个头文件声明函数后面没加分号结束语句
|