https://sourceware.org/bugzilla/show_bug.cgi?id=31761
--- Comment #7 from Nick Clifton <nickc at redhat dot com> --- (In reply to Peter Damianov from comment #5) > Just to be completely clear, the command is incorrect, but the way ld reacts > to the mistake is the problem. In this case, the "file.c" will be deleted, > the user has potentially lost a file, and day ruined. I think refusing to > delete output here is the correct and preferable thing to do. It may seem callous, but if you are using command line tools to build programs then I would argue that a certain level of competence is expected, and that loosing a source file to a silly mistake is actually a useful lesson. But maybe a compromise solution can be reached here. As Alan pointed out, setting the output file name to the name of an existing source file is going to cause problems regardless of whether the link succeeds or fails. So maybe the correct thing to do is to have the "-o <file>" option fail if the output name matches the name of an existing file *and* that name matches a pattern of known source files (eg *.[cChosS] *.cpp) ? What do you think ? -- You are receiving this mail because: You are on the CC list for the bug.