gcc -MF doesn't work as expected

Peter Eisentraut peter_e@gmx.net
Sun Apr 8 09:13:00 GMT 2001


gcc version 3.0 20010408 (prerelease)

$ cat conftest.c
#include <stdio.h>

int main() { return 0; }

$ <path>/gcc -c -M -MF conftest.P conftest.c

writes the preprocessed conftest.c to stdout and creates the conftest.P
file correctly.  No conftest.o file is created.

$ <path>/gcc -c -MD -MF conftest.P conftest.c

Works correctly.  (conftest.o and conftest.P are created, nothing on
stdout.)

While the documentation is ambiguous and underspecifying about the exact
semantics of -MF in absence of -MD, the fact that no object file is
created despite the presence of -c is a bug.

I think what needs to happen is that -MF selects compilation mode (as
opposed to preprocessing mode), like -MD does.  That would make '-MD'
equivalent to '-MF whatever.d', which is probably what a user would
expect.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



More information about the Gcc-bugs mailing list