You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2024/03/15 01:31:01 UTC

[Bug 68763] ring warnings with CFLAGS=-fsanitize=undefined

https://bz.apache.org/bugzilla/show_bug.cgi?id=68763

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Core                        |APR
            Product|Apache httpd-2              |APR
           Assignee|bugs@httpd.apache.org       |bugs@apr.apache.org
            Version|2.5-HEAD                    |1.7.4

--- Comment #3 from Eric Covener <co...@gmail.com> ---
After some confusing results along the way:

* -fno-strict-aliasing no affect
* 1.7.4 fails and trunk works
* just testpoll in apr is enough to hit presumably the same warning (at least
if epoll is built).


The difference seems to be APR_OFFSETOF being used in my 1.7.4 vs
__builtin_offsetof


-E output

1.7.4:

        do { ((&pollset->p->query_ring))->next = (struct pfd_elem_t *)((char
*)(&((&pollset->p->query_ring))->next) - ((long) (((char *) (&(((struct
pfd_elem_t*)((void*)0))->link))) - ((char *) ((void*)0)))));
((&pollset->p->query_ring))->prev = (struct pfd_elem_t *)((char
*)(&((&pollset->p->query_ring))->next) - ((long) (((char *) (&(((struct
pfd_elem_t*)((void*)0))->link))) - ((char *) ((void*)0))))); } while (0);

trunk:
        do { ((&pollset->p->query_ring))->next = (struct pfd_elem_t *)((char
*)(&((&pollset->p->query_ring))->next) - __builtin_offsetof(struct pfd_elem_t,
link)); ((&pollset->p->query_ring))->prev = (struct pfd_elem_t *)((char
*)(&((&pollset->p->query_ring))->next) - __builtin_offsetof(struct pfd_elem_t,
link)); } while (0);

But I couldn't spot what makes them different (I am just configuring both with:
env CC=clang CFLAGS="-fsanitize=undefined" ./configure --prefix=$PWD/built

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org