I ran into a problem on Solaris 10 gcc when building bleeding-edge grep and installed the attached into Gnulib to fix it.