4 ms·
I think CINT was superseded by cling.
by icholy 11y ago
I think CINT was superseded by cling.
- zx2c4 11y agoDoes cling support a C99 or C11 mode? A lot of times, for C development and related endeavors, I want to quickly determine the size of a struct or do some quick tests with strange arithmetic or casting or whatever else. Usually I just write a tiny test program, compile it, run it, and look at my printf output. This is pretty slow though. Having a C REPL would be quite nice. It would be nice to see a wrapper around GCC that does this, for, say, a kernel source REPL.
- icholy 11y agoAFAIK, it's only C++. EDIT: you can pass it the -x c flag.
- zx2c4 11y agoAMAZING: -x c Thanks!
- CyberDildonics 11y agoThe best way might be to use TinyCC. You can compile C to a byte array, cast it to a function and run it. I don't know of any REPL so far though (which is surprising).
- i336_ 11y ago$ git clone https://github.com/zsaleeba/picoc ... Receiving objects: 100% (3305/3305), 1.29 MiB | 0 bytes/s, done. ... $ make ... $ ./picoc -i starting picoc v2.2 beta r picoc> int i = 1; picoc> printf("%d\n", i); 1 picoc> printf("%d\n", sizeof(i)); 4 picoc> You might need to nuke the -DVER in the CFLAGS (this code hasn't changed since it was ported from Google Code, which uses svn, but there's no .svn in the dir anymore, so it breaks). I also needed libreadline6-dev. Oh, and to make things easier, a clickable link: https://github.com/zsaleeba/picoc https://github.com/zsaleeba/picoc
- cozzyd 11y agoNot sure I would trust CINT to pad structs the same way as your compiler.
- i336_ 11y agoAbout a very simple C REPL, see my comment reply to CyberDildonics.