c-semantics icon indicating copy to clipboard operation
c-semantics copied to clipboard

kcc fails without error if _GNU_SOURCE is enabled for fcntl.h

Open diekmann opened this issue 8 years ago • 0 comments

Hi,

I tested kcc with the following "simple" program:

#define _GNU_SOURCE

#include <stdio.h>
#include <fcntl.h>

int main(int argc, char **argv){
        printf("Hello World\n");
        return 0;
}

It fails with the following (not very helpful) error:

Error: Could not find or load main class org.kframework.main.BinaryToText
Translation failed (config dumped). Run kcc -d tests/gnusource.c to see commands run.

It fails with the same error if I enable kserver. If I remove the #define _GNU_SOURCE, everything works fine. Something in the fcntl.h must cause the error.

Tested on vanilla Ubuntu 16.04 with a fresh installation of k and c-semantics as of today.

About my setup: k 1b84d683339e39c7268f2496544fafcdd81fbc8f Dec 13 2016 c-semantics 66b31eb031b99c0f3d14a09871abe68ed48ca96e Dec 15 2016 Installed according to the guide. Ubuntu 16.04.1 LTS

Edit: kcc -Wsystem-headers reports an error. It would be incredibly helpful for starters if kcc would hint that this parameter exists. The current output is quite misleading. Ultimately, the fix is to get the binary rv-match distribution which hopefully can process this header?

diekmann avatar Dec 17 '16 14:12 diekmann