Jetlogan / termbox

Automatically exported from code.google.com/p/termbox
0 stars 0 forks source link

C++-style comments in termbox.h break client code #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
FYI, when building client code in C89 mode, C++-style comments in termbox.h 
break the client:

In file included from mod_termbox.c:11:0:
/home/stephan/include/termbox.h:6:1: error: expected identifier or ‘(’ 
before ‘/’ token
 // for shared objects
 ^
/home/stephan/include/termbox.h:17:43: error: missing terminating ' character 
[-Werror]
 // Key constants. See also struct tb_event's key field.
                                           ^

Whether or not termbox needs c99 should not affect termbox's minimal interface, 
so the header file should be C89-compatible.

Original issue reported on code.google.com by sgbeal@googlemail.com on 22 Jul 2014 at 12:42

GoogleCodeExporter commented 9 years ago
Addenda: the use of fixed-size integer types requires C99 _or_ compatible 
headers in C89 mode, so i would argue that the // comments should still be 
removed so that C89 code using those headers (as i do in a couple projects) can 
still compile. My current workaround is simply to add -std=c99 to the cflags 
for the files which need it.

Original comment by sgbeal@googlemail.com on 22 Jul 2014 at 2:00

GoogleCodeExporter commented 9 years ago
Done, although stdint.h is still there, which is C99 afaik.

P.S. Please report bugs to the github next time, I should close this bug 
tracker eventaully. Sources are hosted on the github anyway.

https://github.com/nsf/termbox/commit/7c1429767b5aaafae

Original comment by no.smile...@gmail.com on 22 Jul 2014 at 2:04