This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -MD together with -save-temps broken

Daniel Egger wrote:-

> -MD still appears to work in cpp (existing behaviour) but is not
> documented in `cpp --help -v`.

Ah, thanks.  I'll fix that soon.
> It seems that cppopts.texi and the cpp seem to differ when it comes
> to validity of the option:
> -------------------------------------------------------------------
> @item -MD
> @opindex MD
> @option{-MD} is equivalent to @option{-M -MF @var{file}}, except that
> @option{-E} is not implied.  The driver determines @var{file} based on
> whether an @option{-o} option is given.  If it is, the driver uses its
> argument but with a suffix of @file{.d}, otherwise it take the
> basename of the input file and applies a @file{.d} suffix.
> -------------------------------------------------------------------
> According to this snipped -MD is legal and supposed to work.

It is legal and does work.

> I would suggest removing this part of the documentation and issue a
> warning if a user tries to use this deprecated option. 
> The alternative would be to mention -MD in cpps help again and fix
> the racial behaviour with -save-temps.

The option is not deprecated, it is still there.  What is not there is
-MD for the *internal* preprocessor.  Remember that "cpp" is just the
driver, which calls the internal preprocessor, "cpp0" at present.  All
documentation is for "cpp" not "cpp0".  -Wp passes stuff straight
through to cpp0, the internal preprocessor, whose behaviour is
undocumented.  So it worked in the past, and automake got lucky, but
it's luck ran out.  This is documented under "-Wp" for 3.1 and 3.2,
but not 3.0 IIRC.
> BTW: I just checked. -M -MF is NOT producing the same behaviour as
> -MD because it does not produce any compiled output at all and it 
> appears that I cannot enable the -E switch.

But the documentation above doesn't claim -M -MF is the same as -MD.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]