[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] enum tccpp phase error
From: |
lifenjoiner |
Subject: |
Re: [Tinycc-devel] enum tccpp phase error |
Date: |
Sun, 15 Jun 2014 12:54:28 +0800 |
Thanks.
It's my typo and didn't see the line number clearly when tested the code
snippet.
I find reason in the original files out:
------------------------
$>tcc -c -o fd.o fd.c
In file included from fd.c:25:
html.h:25: error: ';' expected (got "enum")
------------------------
__BEGIN_DECLS is not defined before the enum as:
------------------------
__BEGIN_DECLS
/* Used for bit-masks: NOT for indexing! */
enum hmode {
HTML_4_01 = 1, /* HTML-4.01 strict */
XHTML_1_0 = 2 /* XHTML-1.0 strict */
};
------------------------
__BEGIN_DECLS is defined in "include\sys\cdefs.h" of MinGW.
And my tcc' header system doesn't include it.
Have a nice day!
> -----Original Message-----
> From: Ramsay Jones [mailto:address@hidden
> Sent: Sunday, June 15, 2014 4:29 AM
> To: address@hidden
> Cc: address@hidden
> Subject: Re: [Tinycc-devel] enum tccpp phase error
>
> On 14/06/14 21:06, address@hidden wrote:
> > /* enum_err.c file */
> > #include <stdio.h>
> >
> > enum hmode {
> > HTML_4_01 = 1, /* HTML-4.01 strict */
> > XHTML_1_0 = 2 /* XHTML-1.0 strict */
> > };
> >
> > int main (int argc; char *argv[])
> --------------------^
> > {
> > return 0;
> > }
> > /* enum_err.c end */
> >
> >
> > ==================================================
> > tcc version 0.9.26 (i386 Win32)
> > ...
> > .../enum_err.c:8: error: ',' expected (got ";")
> >
> > ==================================================
> > Found in source code:
> > tccpp.c:92: tcc_error("'%c' expected (got \"%s\")", c,
> get_tok_str(tok, &tokc));
> > ===> ST_FUNC void skip(int c)
> >
> > ==================================================
> > When I put the enum definition into tcc's tests file, it was complied
> > without
> error!?
> > Is this a bug?
>
> No, it's a syntax error. :P
>
> ATB,
> Ramsay Jones
>