This is the mail archive of the
mailing list for the GCC project.
Re: [libiberty patch]: Change strncmp test in the way it uses mmap
The same reasoning you give for saying "we should do A and not B
because A always works" was the same reasoning that was previously
given for "we should to B and not A because...". You've already shown
a case where a #if can't tell if an OS won't work at runtime, but your
solution doesn't consider other OSs where the new way might also not
work at runtime. Since you've already proven that you can't tell for
sure until you run the test, the solution should involve some sort of
runtime check, not yet another compile time "hope it works" test.
I'm not protective of MAP_FILE. I don't care which mmap is tried
first. I just don't want to have to revisit this test in a month
because someone wants to switch it back to fix *their* OS.