函数声明不是原型error: function declaration isn’t a prototype

现象

在内核编程时,出现错误信息如下:

复制代码
export.h:36:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
 DLL_API bool comMain2();

分析

在内核编程中,参数为空时,必须声明为void。

解决

增加void即可,如下:

c 复制代码
DLL_API bool comMain2(void);
相关推荐
Je1lyfish7 小时前
CMU15-445 (2025 Fall/2026 Spring) Project#3 - QueryExecution
linux·c语言·开发语言·数据结构·数据库·c++·算法
Brilliantwxx8 小时前
【C++】 vector(代码实现+坑点讲解)
开发语言·c++·笔记·算法
叼烟扛炮9 小时前
C++第三讲:类和对象(中)
开发语言·c++·类和对象
KuaCpp9 小时前
C++新特性学习
c++·学习
墨染千千秋9 小时前
C/C++ Keywords
c语言·c++
ximu_polaris9 小时前
设计模式(C++)-行为型模式-中介者模式
c++·设计模式·中介者模式
CSCN新手听安11 小时前
【Qt】Qt窗口(八)QFontDialog字体对话框,QInputDialog输入对话框的使用,小结
开发语言·c++·qt
tumu_C11 小时前
用std::function减缓C++模板代码膨胀和编译压力的一个场景
开发语言·c++
Hical6112 小时前
C++17 实战心得:那些真正改变我写代码方式的特性
c++
Hical6113 小时前
实测:C++20 协程 vs Go Gin vs Rust Actix,谁的 Web 性能更强?
c++