惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

GCC

请问如何将 GCC 编译成一个独立的可执行文件? - V2EX GDB 程序崩溃没有效代码堆栈该怎么调试?要被折磨疯了 - V2EX genssource 编译过不去啊 - V2EX 编译器是如何识别出 ++ 而不是两个加号的?是如何识别出前缀自增和后缀自增的? - V2EX 哪位大神帮忙看一下代码有什么问题 - V2EX 影响Gcc编译速度的瓶颈在哪? - V2EX
询问一个编译原理的问题: implicit declaration of function 'yyerror' is invalid in C99 - V2EX
EchoChan · 2015-06-19 · via GCC

项目是根据

做的,源码在https://github.com/jengelsma/yacc-tutorial
也就是两个文件,
一个https://github.com/jengelsma/yacc-tutorial/blob/master/calc.l
一个https://github.com/jengelsma/yacc-tutorial/blob/master/calc.y
利用命令生成y.tab.c和y.tab.h以及lex.yy.c后,使用gcc lex.yy.c y.tab.c -o calc命令,出现了如下错误
calc.l:11:8: warning: implicit declaration of function 'yyerror' is invalid in
C99 [-Wimplicit-function-declaration]
{ECHO; yyerror ("unexpected character");}
^
1 warning generated.
y.tab.c:1249:16: warning: implicit declaration of function 'yylex' is invalid in
C99 [-Wimplicit-function-declaration]
yychar = YYLEX;
^
y.tab.c:605:16: note: expanded from macro 'YYLEX'
# define YYLEX yylex ()
^
calc.y:46:5: warning: implicit declaration of function 'islower' is invalid in
C99 [-Wimplicit-function-declaration]
if(islower(token)) {
^
calc.y:48:12: warning: implicit declaration of function 'isupper' is invalid in
C99 [-Wimplicit-function-declaration]
} else if(isupper(token)) {
^
3 warnings generated.

Google了一圈,按照http://stackoverflow.com/questions/27220759/linker-error-yacc-on-mac
和http://stackoverflow.com/questions/23717039/generating-a-compiler-from-lex-and-yacc-grammar的说法都没解决。请问这怎么解决?是不是因为os x 内置的GCC编译器只能生成C99风格的代码而造成的?