Follow-up Comment #3, bug #57277 (project findutils):
[comment #1 comment #1:] > First of all, the fix for this should go into gnulib --> adding their ML. > > Then, this test actually wants to verify the behavior of that > function when called with a NULL value (it should return NULL > and set errno to EINVAL). > Therefore, the test needs to suppress that specific sanitizer > error. No, it's not a sanitizer error, it's an error in gnulib code. One can't decorate a function with nonnull attribute and then call the function with NULL. Doing that, an optimizing compiler can do aggressive optimizations. So either the function canonicalize_file_name should accept (and handle NULL), then remove the nonnull attribute, or it can't and then one can't call the function with NULL. Thanks. I don't have a GCC 10, so does something like the > following work? > > > a/tests/test-canonicalize-lgpl.c b/tests/test-canonicalize-lgpl.c > index 4ce06e46c..4e7d47c57 100644 > --- a/tests/test-canonicalize-lgpl.c > +++ b/tests/test-canonicalize-lgpl.c > @@ -39,6 +39,9 @@ SIGNATURE_CHECK (canonicalize_file_name, char *, (const char *)); > > #define BASE "t-can-lgpl.tmp" > > +/* Suppress -fsanitize=null error - seen on GCC 10 - for this test. */ > +extern char *canonicalize_file_name (const char *) __attribute__((no_sanitize("null"))); > + > int > main (void) > { > _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?57277> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/