bug-gperf
[Top][All Lists]
Advanced

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

Strict-aliasing rule breaking


From: Lorenzo Bertini
Subject: Strict-aliasing rule breaking
Date: Thu, 28 Dec 2023 15:40:01 +0100

Dear developers,
as discussed here (https://bugs.gentoo.org/858377), gperf cannot be
build with "-Werror=strict-aliasing". This is what GCC gives me:

In file included from ./keyword-list.h:78,
                 from ./keyword-list.cc:22:
./keyword-list.icc: In member function ‘KeywordExt_List*&
KeywordExt_List::rest()’:
./keyword-list.icc:50:11: error: dereferencing type-punned pointer
will break strict-aliasing rules [-Werror=strict-aliasing]
   50 |   return *reinterpret_cast<KeywordExt_List**>(&_cdr);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./keyword-list.h:78,
                 from ./output.h:27,
                 from ./output.cc:22:

Gentoo recommends "-Werror=strict-aliasing" as part of a project that
allows to build every package with LTO. As more distributions are
transitioning to LTO build, it might be beneficial to not have this
warning.

Thank you for your attention,
best wishes and happy holidays!

Lorenzo



reply via email to

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