description | Run C code from sources |
owner | jrische@laposte.net |
last change | Sat, 22 Jan 2022 22:47:16 +0000 (22 23:47 +0100) |
URL | git://repo.or.cz/c2run.git |
https://repo.or.cz/c2run.git | |
push URL | ssh://repo.or.cz/c2run.git |
https://repo.or.cz/c2run.git (learn more) | |
bundle info | c2run.git downloadable bundles |
content tags |
Fork of Jason A. Donenfeld's cscript
c2run
executes C code from stdin using any variety of compiler arguments. It can be used from the command line:
$ echo 'main(){puts("hello world");}' | c2run
Or it can be used at the top of scripts:
#!/usr/bin/c2run
main(){puts("hello world");}
One might even register .c as an executable file type:
# echo ':cfile:E::c::/usr/bin/c2run:' > /proc/sys/fs/binfmt_misc/register
$ echo 'main(){puts("hello world");}' > a.c
$ chmod +x a.c
$ ./a.c
It respects the CC
environment variable, and does not create any temporary dentries that need to be cleaned up ever.
$ make
$ sudo make install PREFIX=/usr
This project is released under the GPLv2.
2022-01-22 | Julien Rische | Update clang formatmaster | commitcommitdifftreesnapshot (tar.gz zip) |
2022-01-22 | Julien Rische | Move code in dedicated functions | commitcommitdifftreesnapshot (tar.gz zip) |
2022-01-22 | Julien Rische | Fork from cscript | commitcommitdifftreesnapshot (tar.gz zip) |
2021-06-15 | Jason A. Donenfeld | script: use memfd_create instead of O_TMPFILE | commitcommitdifftreesnapshot (tar.gz zip) |
2018-11-27 | Jason A. Donenfeld | example: avoid multi-dimensional array | commitcommitdifftreesnapshot (tar.gz zip) |
2018-07-04 | Jason A. Donenfeld | Initial commit | commitcommitdifftreesnapshot (tar.gz zip) |
2 years ago | master | logtree |