bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gl_array_list.c:452:29: runtime error: applying zero offset to null


From: Jeffrey Walton
Subject: Re: gl_array_list.c:452:29: runtime error: applying zero offset to null pointer
Date: Mon, 1 Nov 2021 20:46:14 -0400

On Mon, Nov 1, 2021 at 4:02 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> On 10/21/21 12:38, Paweł Krawczyk wrote:
>
> > gl_array_list.c:452:29: runtime error: applying zero offset to null pointer
> > SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior 
> > gl_array_list.c:452:29 in
>
> The Gnulib portability assumptions
> <https://www.gnu.org/software/gnulib/manual/html_node/Other-portability-assumptions.html>
> say it's OK to add 0 to a null pointer. If you have a real platform
> (i.e., not a pedantic testing framework) where this is an issue, please
> let us know. Otherwise you might look into some way to have clang not
> nag you about this non-problem.

I believe that's undefined behavior. NULL is not a valid object. I
think the tools are correct in producing a finding.

https://stackoverflow.com/questions/26906621

Jeff



reply via email to

[Prev in Thread] Current Thread [Next in Thread]