> More than once I have been stupid enough to issue the command
Not stupid. Ignorant. Cannot you write a simple shell script
to do your compiles? It's all of two lines and it is not exactly
'C' (read as 'rocket') science:
gcc myprogram.c -o myprogram
./myprogram #Added this gratuitous 3rd line to
#assist you not running the wrong
#You can add the exit value test for
> gcc myprogram.c -o myprogram.c
Uh, uh. This is bad! It has been known to 'scrobble' source code.
Quote:> thus scrobbling my source code.
You invented a new word! I could only find 'scribbling' and
in my dictionary. I must complement you on the 'sniglet'. It does
seem to match the situation.
Quote:>(I saw someone else here recently who had done the same).
Probably the same thread where I lost it. I also submitted
a simple makefile to the poor bloke as a peace offering.
Here's the thread:
You may want to look at the makefile here, although the (above) shell
snippet should keep you out of trouble:
Quote:> Can someone suggest an alias for gcc so I may safely type
> this and get a warning instead?
Well ... I can suggest a name for such a contrivance ... 'noscrobble'!
> The logic would be: if there is an "-o", and if the argument following the
> "-o" ends in ".c", do not proceed as normal, but instead issue a warning.
How about instead of addressing symptoms we address the problem
and you learn how to write simple shell snippets BEFORE you learn
how to do whatever you're doing in 'C'.
> thanks to anyone who can help --brianna
Tim - PITA