Hi Martin, > While looking into opportunities to detect strnlen/strlen coding > mistakes (pr86199) I noticed a bug in the strnlen implementation > I committed earlier today that lets a strnlen() result be saved > and used in subsequent calls to strlen() with the same argument. > The attached patch changes the handle_builtin_strlen() function > to discard the strnlen() result unless its bound is greater than > the length of the string.
the new test FAILs to link on Solaris 10: +FAIL: gcc.dg/strlenopt-46.c (test for excess errors) +UNRESOLVED: gcc.dg/strlenopt-46.c compilation failed to produce executable Excess errors: Undefined first referenced symbol in file strnlen /var/tmp//ccyrOY3M.o ld: fatal: symbol referencing errors. No output written to ./strlenopt-46.exe Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University