kovidgoyal / html5-parser

Fast C based HTML 5 parsing for python
Apache License 2.0
678 stars 33 forks source link

Compile error #4

Closed stoecker closed 7 years ago

stoecker commented 7 years ago

On openSUSE 42.1 it fails due to an ISO-C90 violation (probably caused by a strict compiler option):

https://build.opensuse.org/public/build/home:dstoecker/openSUSE_Leap_42.1/x86_64/python-html5-parser/_log

src/python-wrapper.c:78:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] src/python-wrapper.c:82:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] src/python-wrapper.c:112:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] src/python-wrapper.c:128:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

Could you please fix these warnings/errors?

kovidgoyal commented 7 years ago

html5-parser requires a C99 compiler. As far as I know, mixed declarations and code are perfectly valid in C99. I'm afraid I am not interested in adding support for compilers that are old enough to not support C99.

wumpus commented 7 years ago

The compiler is gcc 4.8, which supports C99. stoecker should look into why -Werror=declaration-after-statement is in the gcc command line.

kovidgoyal commented 7 years ago

The compiler flags come from the python build system. html5-parser's setup.py only adds the following flags:

-O3 -std=c99 -fvisibility=hidden