Open mitchty opened 8 years ago
@mitchty C2HS uses the language-c library to parse header files: the language-c package claims to deal with "all of C99 and a large set of GNU extensions", i.e. it's not a C11 parser. We're getting more and more problems with C2HS due to the default C compilers supplied with distributions moving beyond C99. I know what to do about it, which is to use one of the other Haskell C parsing libraries, but switching C2HS over to a completely new parsing library isn't something I want to do myself.
@ian-ross Fair point, I'll open up a bug against language-c. I think having it work with C11 would be preferable as I don't think it will be going away. I notice it just changed ownership as well so we'll see where this goes. For the moment I'm just hacking stdlib.h to work around things.
I've started working on C11 support in language.c. _Noreturn has been implemented already: https://github.com/visq/language-c/commit/7a1ab1af9b5df9019931412130056cdc173698bf
Noticed this on alpine linux 3.3.1 when compiling the ncurses package.
The error log:
And that section of stdlib.h:
I think it would be ok to just ignore _Noreturn in these cases correct? The function specifier doesn't really change the fact that its a function just specifies that these functions never return to their caller. I couldn't find anything in the source that seems to indicate _Noreturn is parsed at all but if I missed it let me know.