|Re: warning: assignment makes pointer from integer without a cast[enab email@example.com (Danny Pereira) (2016-02-22)|
|Re: warning: assignment makes pointer from integer without a cast[enab firstname.lastname@example.org (Kaz Kylheku) (2016-02-24)|
|Re: warning: assignment makes pointer from integer without a cast[enab email@example.com (George Neuner) (2016-02-24)|
|From:||Kaz Kylheku <firstname.lastname@example.org>|
|Date:||Wed, 24 Feb 2016 15:56:17 +0000 (UTC)|
|Organization:||Aioe.org NNTP Server|
|Injection-Info:||miucha.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="55477"; mail-complaints-to="email@example.com"|
|Posted-Date:||24 Feb 2016 23:54:39 EST|
On 2016-02-22, Danny Pereira <firstname.lastname@example.org> wrote:
> *purelex.l:12:8: warning: assignment makes pointer from integer without a
> cast [enabled by default] yylval=atoi(yytext); *
This tells you that yylval does not have type int as you expect; it is
in fact a pointer to something.
Though presented as a "warning" in GCC, assigning an integer to a
pointer is a constraint violation according to ISO C, requiring a
diagnostic from a conforming implementation, and the behavior
is not well defined if the code is translated and executed anyway.
It is a bad idea to ignore this diagnostic.
Your yylval is a pointer because of the "Bison bridge" option.
This is documented in the GNU Flex manual:
A.2 C Scanners with Bison Parsers
[... few paragraphs down ...]
Note that the macros `yylval' and `yylloc' evaluate to pointers.
Return to the
Search the comp.compilers archives again.