From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18373 invoked by alias); 18 Feb 2002 12:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 18331 invoked by uid 71); 18 Feb 2002 12:26:01 -0000 Resent-Date: 18 Feb 2002 12:26:01 -0000 Resent-Message-ID: <20020218122601.18330.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, osv@javad.ru Received:(qmail 8125 invoked by uid 61); 18 Feb 2002 12:21:23 -0000 Message-Id:<20020218122122.8121.qmail@sources.redhat.com> Date: Mon, 18 Feb 2002 04:26:00 -0000 From: osv@javad.ru Reply-To: osv@javad.ru To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: other/5718: Inconsistent and backwards incompatible handling of '-o' switch. X-SW-Source: 2002-02/txt/msg00428.txt.bz2 List-Id: >Number: 5718 >Category: other >Synopsis: Inconsistent and backwards incompatible handling of '-o' switch. >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Feb 18 04:26:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: osv@javad.ru >Release: version 3.0.3 >Organization: >Environment: Linux falcon 2.2.14 #2 SMP Sat Apr 15 13:24:18 MSD 2000 i686 unknown >Description: gcc doesn't pass '-o' option to preprocessor when both -E and -MD are specified, i.e., when gcc is invoked like this: gcc -E -MD file.c -o file.i the result of preprocessing is output to 'stdout', not into 'file.i'. Having definition of '-MD' from gcc.info: "... This is in addition to compiling the main file as specified--`-MD' does not inhibit ordinary compilation..." and the following behavior: gcc -c file.c -o file.o # sends output to 'file.o' gcc -c -MD file.c -o file.o # sends output to 'file.o' gcc -E file.c -o file.i # sends output to 'file.i' gcc -E -MD file.c -o file.i # ! sends output to 'stdout' I believe the behavior of "-E -MD -o" combination of command-line options is both inconsistent and surprising. gcc before 3.0 (e.g., 2.95.2) behaves correctly, so current behavior is also backwards incompatible. >How-To-Repeat: $ cat file.c void foo() {} $ ~/try/bin/gcc -v -E -MD file.c -o file.i Reading specs from /home/osv/try/lib/gcc-lib/i686-pc-linux-gnu/3.0.3/specs Configured with: /home/osv/cygnus/gcc/configure --prefix=/home/osv/try --disable-nls --with-gnu-as --with-gnu-ld : (reconfigured) Thread model: single gcc version 3.0.3 /home/osv/try/lib/gcc-lib/i686-pc-linux-gnu/3.0.3/cpp0 -lang-c -v -M -MF file.d -MQ file.i -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=3 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ file.c GNU CPP version 3.0.3 (cpplib) (i386 Linux/ELF) ignoring nonexistent directory "/home/osv/try/i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /home/osv/try/include /home/osv/try/lib/gcc-lib/i686-pc-linux-gnu/3.0.3/include /usr/include End of search list. # 1 "file.c" void foo() {} $ cat file.i cat: file.i: No such file or directory $ >Fix: Use gcc -E -MD file.c > file.i instead of gcc -E -MD file.c -o file.i >Release-Note: >Audit-Trail: >Unformatted: