-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop the compiler from destroying the source code #98
Comments
That seems like a special case which command-line tools generally do not worry about.
This destroys test.c. It could only be fixed in a narrow sense, anyhow. We could try to compare the filenames, but that wouldn't catch |
Maybe refuse to write to files ending with .inf? That's the major risk here. |
A simple check that output file is not *.inf, *.c or *.h?
|
I still think this is a bad idea. Even aside from the question of deciding which suffixes to watch for. (They're configured in header.h, not necessarily ".inf" even though we assume that these days. And nothing about the compiler requires you to use ".inf" and ".h" extensions on your files.) There's a lot of mistakes you can make on the command line. Fixes like this will not prevent all of them and will prevent some things that are currently legal. It seems like a misconceived idea and I think it should be closed. |
I tend to agree. |
Sure, it will prevent some things that are currently legal. Like:
(This currently builds a z5 game called mygame.inf, overwriting the source code) And while it wouldn't remove all risks, it would remove some risk. But I don't expect to get get all my suggestions implemented. If you think it's a bad idea, that's fine with me. |
If you specify the name of the source code file twice on the commandline, the source code is overwritten with the compiled file, like:
inform6 +library mygame.inf -v5 -e -s -z mygame.inf
This is pretty nasty.
The text was updated successfully, but these errors were encountered: