This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch libiberty include gcc]: PR debug/28047 DWARF output_file_names should really understan d DOS pathnames
- From: "Nicola Pero" <nicola dot pero at meta-innovation dot com>
- To: "Kai Tietz" <ktietz70 at googlemail dot com>
- Cc: "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>
- Date: Mon, 2 May 2011 15:16:21 +0200 (CEST)
- Subject: Re: [patch libiberty include gcc]: PR debug/28047 DWARF output_file_names should really understan d DOS pathnames
Can I ask for some clarifications on this patch (applied on 2011-02-28) ?
This patch changed the equality function in a hashtable that holds file names, making for example
"/" and "\" identical entries on MS-DOS, but it didn't change the hash function, meaning
"/" and "\" are now identical hashtable entries on MS-DOS, but with a *different* hash.
How can that work ?
Lookups for "/" will look in the slot for that hash, which is not the slot for "\", because "\"
has a different hash. So, unless there is collision, "/" will never even be compared to "\",
and the patch (which changed the comparison function, but not the hash function) would have almost
always no effect as it is.
What am I missing ?
I don't have an MS-DOS machine to test on; I was just reading the code and wondering, so I may well
be missing something important. ;-)
How was the patch tested ? Is there a testcase ?
Thanks