public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: rspier@pobox.com (Robert Spier)
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: preprocessor/6521: -MG creates dependency with wrong path
Date: Tue, 07 May 2002 23:16:00 -0000	[thread overview]
Message-ID: <20020508061621.3119.qmail@sources.redhat.com> (raw)

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

From: rspier@pobox.com (Robert Spier)
To: Neil Booth <neil@daikokuya.demon.co.uk>
Cc: Zack Weinberg <zack@codesourcery.com>, gcc-gnats@gcc.gnu.org,
   gcc-bugs@gcc.gnu.org
Subject: Re: preprocessor/6521: -MG creates dependency with wrong path
Date: Tue, 7 May 2002 23:12:18 -0700

 >> Why is this the intended behavior?  It doesn't make much sense to me=
 .
 >
 >It's intended because it's what the comment in the code says and
 >does.
 
 Ok.. But why?   Beyond it's existence, it doesn't make any sense to
 me.
 
 >I'd welcome a patch to do something more sensible.  You can wait for m=
 e
 >to look at it, but it's pretty near the bottom of my to-do list.
 
 The only sensible patch I can think of is to remove this odd
 functionality entirely.
 
 The below patch unifies handling for system and non-system include
 files and removes the special case.  It only affects -MG, and brings
 it in line with the documentation:
 
       -MG When used with -M or -MM, -MG says to treat missing
            header files as generated files and assume they live
            in the same directory as the source file.  It sup=AD
            presses preprocessed output, as a missing header file
            is ordinarily an error.
 
 The patch is against the 20020506 snapshot. =20
 
 Thanks!
 
 -R
 
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: gcc/cppfiles.c,v
 retrieving revision 1.1
 diff -u -r1.1 gcc/cppfiles.c
 --- gcc/cppfiles.c      2002-05-07 22:33:13-07  1.1
 +++ gcc/cppfiles.c      2002-05-07 22:35:48-07
 @@ -658,28 +658,8 @@
 =20
    if (CPP_OPTION (pfile, print_deps_missing_files) && print_dep)
      {
 -      if (!angle_brackets || IS_ABSOLUTE_PATHNAME (fname))
 +      /* Assume missing headers are in the current directory */
         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 =3D CPP_OPTION (pfile, bracket_includ=
 e);
 -         char *p;
 -         int len =3D 0, fname_len =3D strlen (fname);
 -
 -         if (ptr)
 -           len =3D ptr->len;
 -
 -         p =3D (char *) alloca (len + fname_len + 2);
 -         if (len)
 -           {
 -             memcpy (p, ptr->name, len);
 -             p[len++] =3D '/';
 -           }
 -         memcpy (p + len, fname, fname_len + 1);
 -         deps_add_dep (pfile->deps, p);
 -       }
      }
    /* If -M was specified, then don't count this as an error, because
       we can still produce correct output.  Otherwise, we can't produce=
 
 


             reply	other threads:[~2002-05-08  6:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-07 23:16 Robert Spier [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 14:26 Neil Booth
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-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=20020508061621.3119.qmail@sources.redhat.com \
    --to=rspier@pobox.com \
    --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).