public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "taylor at candd dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug driver/12448] New: -NT / -NQ don't behave as documented. Date: Mon, 29 Sep 2003 21:06:00 -0000 [thread overview] Message-ID: <20030929205632.12448.taylor@candd.org> (raw) 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.
next reply other threads:[~2003-09-29 20:56 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-09-29 21:06 taylor at candd dot org [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20030929205632.12448.taylor@candd.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).