Bug 15185 - -M default target - -MT documentation
Summary: -M default target - -MT documentation
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 3.3.3
: P3 enhancement
Target Milestone: 4.3.0
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-28 02:04 UTC by Fabrice Gautier
Modified: 2008-07-12 17:18 UTC (History)
2 users (show)

See Also:
Host: any
Target: any
Build: any
Known to work:
Known to fail: 3.3.1 3.0.4 3.4.0 4.0.0
Last reconfirmed: 2007-01-08 01:36:09


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabrice Gautier 2004-04-28 02:04:58 UTC
In the gcc info pages the documentation for -M and -MT appears to contradict 
each other as to what the target name should be by default:

`-M':
  [...]
  Unless specified explicitly (with `-MT' or `-MQ'), the object file
  name consists of the basename of the source file with any suffix
  replaced with object file suffix.

`-MT TARGET':
  [...] By
  default, CPP takes the name of the source file, including any
  path, deletes any file suffix such as `.c', and appends the
  platform's usual object suffix. The result is the target.

My understanding is that the `basename' (used in -M doc) is the filename 
without the path. 
My experience also shows the real default behaviour is the one described in -M 
description, not in -MT description. (tested on 2.95 and 3.3.3)

I, for one, would like the behaviour described in -MT.

So this bug report includes:
- a documentation error.
- a request for a new -Mx directive to use filename including path for default 
target name.

Thanks

F.G.
Comment 1 Andrew Pinski 2004-04-28 02:13:17 UTC
Confirmed.
Comment 2 Tom Tromey 2007-01-08 01:36:09 UTC
I've submitted a patch.
As explained in the message, I think we should just document
the current behavior, not change it.
Comment 3 patchapp@dberlin.org 2007-01-08 15:30:39 UTC
Subject: Bug number PR preprocessor/15185

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00532.html
Comment 4 patchapp@dberlin.org 2007-01-11 01:26:34 UTC
Subject: Bug number PR preprocessor/15185

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00866.html
Comment 5 Tom Tromey 2007-01-11 16:27:18 UTC
Subject: Bug 15185

Author: tromey
Date: Thu Jan 11 16:26:55 2007
New Revision: 120679

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120679
Log:
	PR preprocessor/15185, PR preprocessor/20989:
	* doc/cppopts.texi <-MT>: Update description of algorithm for
	computing default target.
	<-M, -MD>: Reword "basename" text.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/doc/cppopts.texi

Comment 6 Tom Tromey 2008-07-12 17:18:47 UTC
This was fixed for 4.3, and I think it unlikely that anyone will
backport the doc fix.  So, I am closing this.