This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't pass NULL pointer to error [BZ #24556]


* H. J. Lu:

> In function ‘error’,
>     inlined from ‘do_one_test’ at bench-strstr.c:149:7,
>     inlined from ‘do_test’ at bench-strstr.c:201:5,
>     inlined from ‘test_main’ at bench-strstr.c:220:2:
> ../include/bits/../../misc/bits/error.h:42:5: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
>    42 |     __error_alias (__status, __errnum, __format, __va_arg_pack ());
>       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Isn't this warning wrong for glibc in general (but not for
_dl_debug_printf)?

I think printing "(null)" for null pointers is a widely-used GNU
extension.

Martin, I assume this warning is yours.  Has this matter come up during
its implementation?

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]