public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/12448] New: -NT / -NQ don't behave as documented.
@ 2003-09-29 21:06 taylor at candd dot org
  2003-09-29 21:19 ` [Bug driver/12448] -MT / -MQ " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: taylor at candd dot org @ 2003-09-29 21:06 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12448

           Summary: -NT / -NQ don't behave as documented.
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: driver
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: taylor at candd dot org
                CC: gcc-bugs at gcc dot gnu dot org

In gcc/doc/cppopts.texi, in the description of -MT it says:

    Change the target of the rule emitted by dependency generation.  By
    default CPP takes the name of the main input file, including any path,
    deletes any file suffix such as @samp{.c}, and appends the platform's
    usual object suffix.  The result is the target.

    An @option{-MT} option will set the target to be exactly the string you
    specify.  If you want multiple targets, you can specify them as a single
    argument to @option{-MT}, or use multiple @option{-MT} options.

My reading of this is that if you specify -MT <target>, then the
default target will *NOT* be used.

And examining the code, that appears to be the intent -- for each
target specified with -MT / -MQ, deps_add_target is called.  And after
processing such arguments, deps_add_default_target is called (by
cpp_read_main_file) which only adds the default target if there are no
targets already specified.

But, that isn't the full story.  In gcc.c, variable
cpp_unique_options, we find this line:

    %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}}

which causes the default target to get added unilaterally.

I believe that either this line should disappear totally or it should
be changed to:

    %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}}

i.e., have !MT && !MQ added as a condition.

I have lightly tested both solutions; they both appear to work.


^ permalink raw reply	[flat|nested] 17+ messages in thread
[parent not found: <bug-12448-6090@http.gcc.gnu.org/bugzilla/>]
[parent not found: <bug-12448-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2014-02-16 13:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-29 21:06 [Bug driver/12448] New: -NT / -NQ don't behave as documented taylor at candd dot org
2003-09-29 21:19 ` [Bug driver/12448] -MT / -MQ " pinskia at gcc dot gnu dot org
2003-10-01 17:39 ` pinskia at gcc dot gnu dot org
2003-10-03 14:34 ` taylor at candd dot org
2003-10-05 18:17 ` vvas at hal dot csd dot auth dot gr
2003-11-18  7:20 ` pinskia at gcc dot gnu dot org
2003-12-23 14:19 ` steven at gcc dot gnu dot org
2004-01-10 22:32 ` pinskia at gcc dot gnu dot org
2004-05-26 22:43 ` pinskia at gcc dot gnu dot org
2005-02-15  6:17 ` ppluzhnikov at charter dot net
     [not found] <bug-12448-6090@http.gcc.gnu.org/bugzilla/>
2005-12-11 18:46 ` pinskia at gcc dot gnu dot org
2007-01-20  6:20 ` tromey at gcc dot gnu dot org
2007-01-22  3:29 ` tromey at gcc dot gnu dot org
2007-01-22  3:30 ` patchapp at dberlin dot org
2007-03-13 23:51 ` tromey at gcc dot gnu dot org
2010-09-02 11:48 ` jsm28 at gcc dot gnu dot org
     [not found] <bug-12448-4@http.gcc.gnu.org/bugzilla/>
2014-02-16 13:13 ` jackie.rosen at hushmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).