This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/57784] New: GCC inadvertedly truncates source text
- From: "mtodorov3_69 at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 02 Jul 2013 17:23:07 +0000
- Subject: [Bug driver/57784] New: GCC inadvertedly truncates source text
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57784
Bug ID: 57784
Summary: GCC inadvertedly truncates source text
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: driver
Assignee: unassigned at gcc dot gnu.org
Reporter: mtodorov3_69 at yahoo dot com
The example goes as follows:
The line:
# gcc -o mypatch mypatch.cc -lstdc++
is mistyped as:
# gcc -o mypatch.cc -lstdc++
GCC complains about no main() and truncates the C++ source to zero length!
Correct would be to complain about wrong number of arguments before doing any
action on mypatch.cc.
Would it hurt to check suffix of the file referenced by "-o" option, if it is
common that object file is overwritten? Few executables' names end with ".cc"
or ".c".
Fortunatelly, the source was recovered with minimal loss of changes from backup
location :-)
Greetz,
mt