This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR preprocessor/39533: -MM may list a header file twice
- From: Tom Tromey <tromey at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 26 Mar 2009 13:34:31 -0600
- Subject: Re: PATCH: PR preprocessor/39533: -MM may list a header file twice
- References: <20090324172312.GA1914@lucon.org>
- Reply-to: tromey at redhat dot com
>>>>> "HJ" == H J Lu <hongjiu.lu@intel.com> writes:
HJ> -MM may list a header file twice. It is caused by duplicated cpp_dir
HJ> entry in file hash. make_cpp_dir may create a cpp_dir for "foo/"
HJ> when pfile->quote_include is set to "foo" by -I. We wind up creating
HJ> a cpp_dir entry for "foo/" with the next cpp_dir entry points to "foo".
HJ> This patch checks if pfile->quote_include points to the same directory
HJ> as DIR_NAME. OK for 4.5?
Can you give an example showing how to reproduce this?
HJ> + unsigned int dir_len;
Should be size_t.
HJ> + /* All non-empty directory names should end in a '/'. Check if
HJ> + pfile->quote_include is the same as DIR_NAME. We don't want to
HJ> + add an duplicated cpp_dir entry here. */
HJ> + dir_len = strlen (dir_name);
HJ> + if (dir_len == (pfile->quote_include->len + 1)
HJ> + && strncmp (dir_name, pfile->quote_include->name,
HJ> + pfile->quote_include->len) == 0)
HJ> + dir = pfile->quote_include;
I don't really understand this.
I'd like to reproduce the problem myself.
Tom