Here's the prompt immediately before that, writing the code to a file. (Which I'm now realizing wasn't quite formatted right, but it worked anyway.)
Interestingly, it didn't like so I had to manually add the declaration for printf.
Here's the prompt immediately before that, writing the code to a file. (Which I'm now realizing wasn't quite formatted right, but it worked anyway.)
Interestingly, it didn't like so I had to manually add the declaration for printf.
Have it print some compiler flags.
// Environment info fprintf (stdout, "file: %s, line:\n %d; c++: %d | date: %s", __FILE__, __LINE__, __cplusplus, __DATE__);
// gcc version fprintf (stdout, "v%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
I only did the environment info, but here it is:
file: flags.c, line: 4; c++: 201103L | date: Feb 6 2023
see if the gcc version matches the
__cplusplus
version levelDid it again with the gcc version, got this:
file: flags.c, line: 11; c++: 201402L | date: Feb 6 2023 v8.4.0
A different C++ version this time, idk if the gcc version matches.
201103L
and201402L
are both real. interestingIt shouldn't print the
L
. In 8.4.0, the the __cplusplus version is:c++: 201402
But it also should be done in just raw dawg
c
mode so__cplusplus
shouldn't be set and should fail to compile.the
flags.c
is interesting. did you specify that file? or is that being conjured as the "best fit" file from it's neuron soup?I named it that. I did
echo "...code here..." > flags.c
Side note: at one point I tried to get it to do vim so I don't have to echo into a file like that, but it couldn't handle that. It would probably have been a worse experience anyway tbh.
should be using
ed
anyways, none of this multiline shit