public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Neil Booth <neil@daikokuya.demon.co.uk>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: preprocessor/6521: -MG creates dependency with wrong path
Date: Wed, 08 May 2002 14:26:00 -0000	[thread overview]
Message-ID: <20020508212603.12810.qmail@sources.redhat.com> (raw)

The following reply was made to PR preprocessor/6521; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.demon.co.uk>
To: Zack Weinberg <zack@codesourcery.com>
Cc: Robert Spier <rspier@pobox.com>, gcc-gnats@gcc.gnu.org,
	gcc-bugs@gcc.gnu.org
Subject: Re: preprocessor/6521: -MG creates dependency with wrong path
Date: Wed, 8 May 2002 22:25:03 +0100

 Zack Weinberg wrote:-
 
 > > > Robert, would you be willing to clarify the documentation?
 > > 
 > > OK, I'll apply Robert's patch.  What do you feel is unclear about
 > > the docs?  The fact that it refers to "current directory"?
 > 
 > Precisely.
 > 
 > I'm not sure how best to clarify it, without rewriting all the stuff
 > about dependency output (which needs doing, but I don't have time
 > now).
 
 OK, I've applied this.
 
 Neil.
 
 2002-05-08  Robert Spier <rspier@pobox.com>
 	    Neil Booth  <neil@daikokuya.demon.co.uk>
 
 	PR preprocessor/6521
 	* cppfiles.c (handle_missing_header): Don't do anything
 	different for <> includes.
 doc:
 	* cppopts.texi: Update documentation for -MG.
 
 Index: cppfiles.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/cppfiles.c,v
 retrieving revision 1.147
 diff -u -p -r1.147 cppfiles.c
 --- cppfiles.c	22 Apr 2002 17:48:01 -0000	1.147
 +++ cppfiles.c	8 May 2002 21:15:19 -0000
 @@ -658,30 +658,7 @@ handle_missing_header (pfile, fname, ang
    int print_dep = CPP_PRINT_DEPS(pfile) > (angle_brackets || pfile->map->sysp);
  
    if (CPP_OPTION (pfile, print_deps_missing_files) && print_dep)
 -    {
 -      if (!angle_brackets || IS_ABSOLUTE_PATHNAME (fname))
 -	deps_add_dep (pfile->deps, fname);
 -      else
 -	{
 -	  /* If requested as a system header, assume it belongs in
 -	     the first system header directory.  */
 -	  struct search_path *ptr = CPP_OPTION (pfile, bracket_include);
 -	  char *p;
 -	  int len = 0, fname_len = strlen (fname);
 -
 -	  if (ptr)
 -	    len = ptr->len;
 -
 -	  p = (char *) alloca (len + fname_len + 2);
 -	  if (len)
 -	    {
 -	      memcpy (p, ptr->name, len);
 -	      p[len++] = '/';
 -	    }
 -	  memcpy (p + len, fname, fname_len + 1);
 -	  deps_add_dep (pfile->deps, p);
 -	}
 -    }
 +    deps_add_dep (pfile->deps, fname);
    /* If -M was specified, then don't count this as an error, because
       we can still produce correct output.  Otherwise, we can't produce
       correct output, because there may be dependencies we need inside
 Index: doc/cppopts.texi
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/doc/cppopts.texi,v
 retrieving revision 1.5
 diff -u -p -r1.5 cppopts.texi
 --- doc/cppopts.texi	7 Apr 2002 03:12:23 -0000	1.5
 +++ doc/cppopts.texi	8 May 2002 21:15:22 -0000
 @@ -204,10 +204,13 @@ When used with the driver options @optio
  
  @item -MG
  @opindex MG
 -When used with @option{-M} or @option{-MM}, @option{-MG} says to treat missing
 -header files as generated files and assume they live in the same
 -directory as the source file.  It suppresses preprocessed output, as a
 -missing header file is ordinarily an error.
 +In conjunction with an option such as @option{-M} requesting
 +dependency generation, @option{-MG} assumes missing header files are
 +generated files and adds them to the dependency list without raising
 +an error.  The dependency filename is taken directly from the
 +@code{#include} directive without prepending any path.  @option{-MG}
 +also suppresses preprocessed output, as a missing header file renders
 +this useless.
  
  This feature is used in automatic updating of makefiles.
  


             reply	other threads:[~2002-05-08 21:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-08 14:26 Neil Booth [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-05-08 14:36 Robert Spier
2002-05-08 14:33 neil
2002-05-08 13:56 Zack Weinberg
2002-05-08 13:26 Neil Booth
2002-05-08 13:16 Zack Weinberg
2002-05-08 10:36 Neil Booth
2002-05-08  9:36 Tom Tromey
2002-05-08  0:06 Zack Weinberg
2002-05-07 23:56 Roland McGrath
2002-05-07 23:46 Neil Booth
2002-05-07 23:36 Neil Booth
2002-05-07 23:16 Robert Spier
2002-05-04  1:16 Neil Booth
2002-05-03 13:06 Robert Spier
2002-05-03  9:56 Zack Weinberg
2002-05-03  5:56 Neil Booth
2002-04-30 13:36 rspier

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=20020508212603.12810.qmail@sources.redhat.com \
    --to=neil@daikokuya.demon.co.uk \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@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: link
Be 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).