buggperf - Bugs: bug #65129, -Wstrict-aliasing warnings

 
 

bug #65129: -Wstrict-aliasing warnings

Submitter:  None
Submitted:  Fri 05 Jan 2024 01:23:34 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 06 Jan 2024 11:15:25 PM UTC, comment #1: 

   50 |   return reinterpret_cast<KeywordExt_List*>(&_cdr);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./keyword-list.h:78,
                 from ./search.h:27,
                 from ./search.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);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
make[1]: * [Makefile:119: main.o] Error 1
cc1plus: some warnings being treated as errors
make[1]: * [Makefile:109: input.o] Error 1
cc1plus: some warnings being treated as errors
make[1]: * [Makefile:117: output.o] Error 1
cc1plus: some warnings being treated as errors
make[1]: * [Makefile:115: search.o] Error 1
make[1]: Leaving directory '/var/tmp/portage/dev-util/gperf-3.1-r1/work/gperf-3.1/src'
make: * [Makefile:34: all] Error 2

  • ERROR: dev-util/gperf-3.1-r1::gentoo failed (compile phase):
  •   emake failed

----------------------------------------------------------------

Portage 3.0.59 (python 3.11.7-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-13, glibc-2.37-r7, 6.6.7-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-6.6.7-gentoo-x86_64-x86_64-AMD_Ryzen_9_5950X_16-Core_Processor-with-glibc2.37
KiB Mem:    65753592 total,  13375944 free
KiB Swap:    2662396 total,   2662396 free
Timestamp of repository gentoo: Fri, 05 Jan 2024 14:30:01 +0000
Head commit of repository gentoo: b750b158ab8ce00579901ef253c8a2594cee1886
Timestamp of repository amedeos: Fri, 05 Jan 2024 11:04:48 +0000
Head commit of repository amedeos: c970a9c9b50419067658f8444b65cc846285ad20

Timestamp of repository brother-overlay: Tue, 26 Dec 2023 14:18:05 +0000
Head commit of repository brother-overlay: 18efecd707fd1ed6ced4695c65294c5c945c78c6

Timestamp of repository gamerlay: Wed, 27 Dec 2023 21:02:07 +0000
Head commit of repository gamerlay: 1d29614d93ba6e2d084e96f540b463013ebd0161

Timestamp of repository guru: Fri, 05 Jan 2024 11:04:48 +0000
Head commit of repository guru: 54fe44c659dac6219ad6b4c285872bf4210a9ca1

Timestamp of repository sspreitz: Tue, 26 Dec 2023 14:18:10 +0000
Head commit of repository sspreitz: 27fffea9b8d573e9dd9f87c0505fdc5c77e7ec4f

Timestamp of repository steam-overlay: Fri, 05 Jan 2024 11:04:43 +0000
Head commit of repository steam-overlay: 04a88bb41dc65144181e649c9139f074bf725abd

Timestamp of repository thegreatmcpain: Fri, 05 Jan 2024 11:04:48 +0000
Head commit of repository thegreatmcpain: 2d4a2e799a0c81f351be632005944fb8d6ad2198

sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p7) 2.40.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-lang/perl:             5.38.2-r1::gentoo
dev-lang/python:           3.11.7::gentoo, 3.12.1::gentoo
dev-lang/rust:             1.71.1::gentoo
dev-util/cmake:            3.27.9::gentoo
dev-util/meson:            1.3.0-r2::gentoo
sys-apps/baselayout:       2.14-r1::gentoo
sys-apps/openrc:           0.48::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r6::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r9::gentoo, 2.41-r2::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           16.0.6::gentoo
sys-devel/gcc:             13.2.1_p20230826::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             16.0.6::gentoo
sys-devel/llvm:            16.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r7::gentoo
Repositories:



ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=znver3 -pipe -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=znver3 -pipe -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -march=znver3 -pipe -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=znver3 -pipe -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j30"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="ABI_X86="(64)" X a52 aac acl acpi activities alsa amd64 bluetooth branding bzip2 cairo cdda cdr cli crypt cuda cups dbus declarative dri dts dvd dvdr elogind encode exif flac fortran gdbm gif gpm gtk gui iconv icu ipv6 jpeg kde kwallet lcms libnotify libtirpc lto mad mng mp3 mp4 mpeg mtp multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf pipewire plasma png policykit ppds pulseaudio qml qt5 readline screencast sdl seccomp semantic-desktop sound spell split-usr ssl startup-notification svg test-rust tiff truetype udev udisks unicode upower usb vorbis vulkan wayland widgets wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS


Linux 6.6.7-gentoo-x86_64 #2 SMP PREEMPT_DYNAMIC Fri Dec 22 19:05:34 EST 2023 x86_64 AMD Ryzen 9 5950X 16-Core Processor AuthenticAMD GNU/Linux

Anonymous
Fri 05 Jan 2024 01:23:34 PM UTC, original submission:  

```
./configure CC=gcc-13 CXX=g++-13; make CFLAGS="-O2 -Werror=strict-aliasing" CXXFLAGS="-O2 -Werror=strict-aliasing" CC=gcc-13 CXX=g++-13
[...]
g++-13 -O2 -Werror=strict-aliasing -I. -I./../lib -c ./keyword-list.cc
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);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
make[1]: * [Makefile:107: keyword-list.o] Error 1
make[1]: Leaving directory '/tmp/gperf/src'
make: * [Makefile:34: all] Error 2
```

```
$ gcc-13 --version
gcc-13 (Gentoo Hardened 13.2.1_p20231230 p11) 13.2.1 20231230
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code