warning: conflicting types for built-in function 'puts'
【编译器版本】
arm-linux-gcc 3.4.1
【问题描述】
在做嵌入式底层开发时,自己写了一个puts函数,也就是通过串口发送字符串到超级终端。但在编译程序的时候出现了如下问题:
warning: conflicting types for built-in function 'puts'
【问题分析】
在C语言标准中,有些通用函数被定义为built-in function(内建函数),像printf,puts,strchr,memset等等,这些函数不需要包含头文件中的声明,就可以编译连接该函数的。但有时候你想自己实现,就会出现上面所示的冲突提示。
有的时候你不用包含一些头文件,也能使用那个里面包含的函数,可能是编译器包含了一些常用的简单的函数的处理,即便是你不包含头文件,编译器也知道到哪里找,但是如果是一些复杂的函数,或者是你自己写的静态库,你想使用时必须要包含;仅仅只是一些简单的函数你不用包含头文件而已。
【解决办法】
1.在编译是加上-fno-builtin或者-fno-builtin-FUNCTION 选项,你就可以自己实现这些函数而不冲突了。例如在上面的提示中,你编译时加上-fno-builtin-puts ,就可以正常编译了。
2.把这些函数改个名称,以便不冲突。
分享到:
相关推荐
1、问题场景: npm install 报错,以为是npm问题,改成cnpm install,也还是报错,根据错误信息提示,...peerDependencies WARNING eslint-plugin-vue@5.2.3 › vue-eslint-parser@^5.0.0 requires a peer of eslint@
Self-healing is a key functionality of Self-Organizing Networks (SON). There have already been promising research results on Degradation Detection and ...a baseline for self-healing in mobile networks.
Android 出现问题Installation error: INSTALL_FAILED_CONFLICTING_PROVIDER解决办法 最近做项目遇到 Installation error: INSTALL_FAILED_CONFLICTING_PROVIDER这个报错信息,不知该如何解决,百度一下,发现有...
官方离线安装包,亲测可用
No declaration for function ''xxx'' -------------------没有函数xxx的说明 No stack ---------------缺少堆栈 No type information ------------------没有类型信息 Non-portable pointer assignment --------...
Read_data.py 调试filename = os.path.splitext(f.split("/")[-1])[0]有问题在Windows下路径应当为
冲突大小写问题此自述文件概述了在此 Ember 应用程序上进行协作的详细信息。 这个应用程序的简短介绍可以很容易地转到这里。先决条件您将需要在您的计算机上正确安装以下东西。 (带有 NPM)安装git clone 这个仓库...
在安装gmt时,出现错误: Error: Problem: package gmt-6.0.0-1.el8.... - conflicting requests - nothing provides libsz.so.2()(64bit) needed by netcdf-4.7.0-2.el8.x86_64 把这个文件安装后,就正常了。
- added 'pseudo device' in common USB code for the device creation. This makes the HCs independent from the device specific code. - USB MSD: added support for disk image modes (like ATA disks) - ...
RELEASE NOTES FOR MICROSOFT(R) TCP/IP-32 FOR WINDOWS(TM) FOR WORKGROUPS 3.11 PLEASE READ THIS ENTIRE DOCUMENT General ------- This product is compatible with, and supported exclusively on, the ...
直接复制至node_modules npm run dev 即可
gmp-5.0.1、mpfr-3.1.0.tar、mpc-0.9.tar打包下载,拥有安装gcc编译器时用到的3个库文件
内网环境安装mysql5.7数据库所需deb安装包,libaio1_0.3.110-2_amd64.deb ,libmecab2_0.996-1.2ubuntu1_amd64.deb ,libmysqlclient20_5.7.25-1ubuntu16.04_amd64.deb,libmysqlclient-dev_5.7.25-1ubuntu16.04_amd...
See the procedure for repartitioning hard disks in Chapter 4 of the Microsoft MS-DOS Getting Started guide. 2.11 286 Accelerator Cards -------------------------- If your system includes a 286 ...
Base Class Library for RS232 Communications. Ref: "Serial Comm: Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications" John Hind, MSDN Magazine, Oct 2002. V1.3 February...
This book is about OSGi’s role in enterprise Java and how the Spring Dynamic Modules for OSGi (Spring-DM) fulfills this role. I first learned about OSGi when the Eclipse IDE started using it in its ...
Paperback: 254 pages ... Also included is a discussion of the most recent developments in the field and prospects for the future, which have been much changed by the arrival of the World Wide Web.
There is continuously increasing interest in research on multi-sensor data fusion technology. Because Dempster’s rule of combination can be problematic when dealing with conflicting data, there are ...
typedef struct Node{ ... for (i=0;i;i++) { list[i]=(Node* )malloc (sizeof(Node )); list[i]->next=NULL; } p=head->next->next; i=0; while (i!=10) { while ((p->value)>=0) { if (flog ==1)
accesses due to the conflicting need for both load balancing and directory update efficiency. We present a flexible approach that addresses the problems of the existing techniques. The approach, ...