Redian新闻
>
有没有朋友懂yacc,真诚请教
avatar
有没有朋友懂yacc,真诚请教# Unix - 噫吁兮,危乎高哉
s*2
1
没有朋友懂yacc的,我有一个bug,始终不知道怎么解决,真诚请教。
我有一个问题,我在运行程序以后出现:
compl.l: In function `yylex':
compl.l:75: warning: assignment makes integer from pointer without a cast
/tmp/ccKAECtZ.o(.text+0x1466): In function `main':
/tmp/ccovPdqh.o(.text+0x1fd): first defined here
/usr/bin/ld: Warning: size of symbol `main' changed from 40 in /tmp/ccovPdqh
.o to 596 in /tmp/ccKAECtZ.o
/tmp/ccKAECtZ.o(.text+0x2a8): In function `yylex':
collect2: ld returned 1 exit status
这种情况是哪里出了错,我该怎么样修改呢?
十分感谢。
avatar
c*t
2
难道你不会看 error message ?写的很清楚嘛:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^
说你有两个 main 。估计是你的 lex/yacc 里面自动生成一个,就跟你的 main
冲突了。
ccovPdqh
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
你有用到 warning 的 function ,但是你并没有 define 。

【在 s*******2 的大作中提到】
: 没有朋友懂yacc的,我有一个bug,始终不知道怎么解决,真诚请教。
: 我有一个问题,我在运行程序以后出现:
: compl.l: In function `yylex':
: compl.l:75: warning: assignment makes integer from pointer without a cast
: /tmp/ccKAECtZ.o(.text+0x1466): In function `main':
: /tmp/ccovPdqh.o(.text+0x1fd): first defined here
: /usr/bin/ld: Warning: size of symbol `main' changed from 40 in /tmp/ccovPdqh
: .o to 596 in /tmp/ccKAECtZ.o
: /tmp/ccKAECtZ.o(.text+0x2a8): In function `yylex':
: collect2: ld returned 1 exit status

avatar
s*2
3
谢谢。
可是我没有用到warning这个function.所以我就不明白了。
我是新手,实验室也没有人做这方面。还请多指教。多谢。

【在 c*****t 的大作中提到】
: 难道你不会看 error message ?写的很清楚嘛:
:
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: 说你有两个 main 。估计是你的 lex/yacc 里面自动生成一个,就跟你的 main
: 冲突了。
: ccovPdqh
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: 你有用到 warning 的 function ,但是你并没有 define 。

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。