keil stdio.h
extern _ARMABI int fputc(int /*c*/, FILE * /*stream*/) __attribute__((__nonnull__(2)));
/*
* writes the character specified by c (converted to an unsigned char) to
* the output stream pointed to by stream, at the position indicated by the
* asociated file position indicator (if defined), and advances the
* indicator appropriately. If the file position indicator is not defined,
* the character is appended to the output stream.
* Returns: the character written. If a write error occurs, the error
* indicator is set and fputc returns EOF.
*/
1. 商业公司,赚钱是目的。有一部分源代码,还是不会以源码的形式给出的。
ARM is a chip architecture.
ABI is application binary interface. https://community.st.com/t5/stm32-mcus-products/what-does-quot-armabi-quot-mean/m-p/186698
2. keil 特有的吧?
_ARMABI is a Keil-specific #define. It isn't used in STM32CubeIDE. The toolchain within STM32CubeIDE comes with its own standard library files, you shouldn't need to copy the Keil ones over.
https://community.st.com/t5/stm32cubeide-mcus/unknown-type-name-armabi/td-p/291050
printf函数的原型,printf()在 C 标准库函数中实质是一个宏,这个宏extern _ARMABI int printf是什么意思?
https://zhidao.baidu.com/question/2056717816879546907.html
extern _ARMABI int printf(const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1)));
请问这个宏是什么意思?能不能解释一下这个宏?宏不是用"#define"的吗?
追答
extern表示这是一个外部函数的声明;
_ARMABI 表示这是一个针对ARM的二进制接口;
__attribute__((__nonnull__(1))) 表示调用函数时第一个参数不能为NULL,
__attribute__() 是用于“修饰”函数的,
__nonnull__(1) 表示第一个参数不为空。
int printf(const char * __restrict /*format*/, ...)
这一部分则是printf()函数的原型,后面的“…”表示这是一个可变参数的函数,即函数参数的数量、类型都可以变化的函数。