rhysu / c99sh Goto Github PK
View Code? Open in Web Editor NEWA shebang-friendly script for "interpreting" single C99, C11, and C++ files, including rcfile support.
License: BSD 2-Clause "Simplified" License
A shebang-friendly script for "interpreting" single C99, C11, and C++ files, including rcfile support.
License: BSD 2-Clause "Simplified" License
Should be no reason standard input can't be accommodated with some exec
magic.
Seeing repeated include issues with a script like the following:
#!/home/rhys/bin/cxxsh -m
#include <random>
using namespace std;
which should compile without incident. Problem may be for any include not in an RC file, but I've not tracked it down.
Once for --cflags
and once for --libs
should be optimal.
Look over changes from #31 to see if they can be tightened up some.
Would aid having small, clean scripts to have a single flag enact -Wall -Werror. Maybe worth separating the two. Certainly something possible in an RCfile.
For here document usage, it would be nice to have a way to dump the contents into an autogenerated main()
routine. In conjunction with GCC's nested functions, this might not be that hideous looking.
This would permit evilness like using namespace std;
within cxxshrc.
Is there another way to write the shebang line #!/usr/bin/env c99sh
, so that a .c file supports both c99sh invocation, as well as traditional gcc compilation? I think this shebang would be rejected by most C compilers?
See if http://gcc.gnu.org/onlinedocs/cpp/Index-of-Directives.html#Index-of-Directives can be mungled to permit comments within the c99shrc files.
Provide a single command line option that will include the useful majority of C99. This might include a subset of
#include <alloca.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <regex.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/types.h>
#include <tgmath.h>
#include <time.h>
as well as -lm
. Intent is to simplify here documents.
Turns out this doesn't read from stdin when run...
#!/home/rhys/bin/c99sh -sm
char name[255] = "Oxford";
int age = 8;
puts("What's your name?");
scanf("%s", name);
puts("What's your birthday?");
printf("Hello, %s. You are %d years old.\n", name, age);
What license is this code under?
Use the examples and some diff magic (or better) to cook a regression testing suite.
Discovered that the suggested dual-shebang doesn't pick up positional args. Fun.
Might be possible to bring up the compiler early, in the background, against a named pipe. This would let the OS do its thing for the compiler while we're out hitting RC files and pkg-config. Small chance it'll improve latency.
1> bash c99sh
c99sh: line 126: pkg: unbound variable
1> bash --version
GNU bash, Version 4.3.30(1)-release (x86_64-pc-linux-gnu) (Debian Jessie)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.