|
From: | Paul Eggert |
Subject: | Re: gl_array_list.c:452:29: runtime error: applying zero offset to null pointer |
Date: | Mon, 1 Nov 2021 18:13:09 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
On 11/1/21 17:46, Jeffrey Walton wrote:
I believe that's undefined behavior.
Yes, of course it is. But the Gnulib code works on all practical platforms, so it's OK. Gnulib is a practical project not a theoretical one, and it uses undefined behavior in several ways other than this one. As long as the code works on real systems there's no real problem.
Most likely Paweł can configure his testing environment to suppress these false alarms. If not, I suggest firing off a bug report to the Clang developers, asking for an easy way to suppress them. In practice these particular diagnostics are more trouble than they're worth.
[Prev in Thread] | Current Thread | [Next in Thread] |