Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 909433

Summary: kde-frameworks/kimageformats-5.107.0 fails to compile (lto): src/imageformats/psd.cpp:828:23: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
Product: Gentoo Linux Reporter: Kostadin Shishmanov <kostadinshishmanov>
Component: Current packagesAssignee: Gentoo KDE team <kde>
Status: RESOLVED FIXED    
Severity: normal Keywords: UPSTREAM
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
URL: https://bugs.kde.org/show_bug.cgi?id=471829
See Also: https://invent.kde.org/frameworks/kimageformats/-/merge_requests/159
Whiteboard: fixed in 5.108
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550, 910062    
Attachments: build log and emerge --info

Description Kostadin Shishmanov 2023-07-01 10:28:21 UTC
Created attachment 864944 [details]
build log and emerge --info

kde-frameworks/kimageformats-5.107.0 fails to compile with -Werror=strict-aliasing in CFLAGS and LDFLAGS

FAILED: src/imageformats/CMakeFiles/kimg_psd.dir/psd.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DKF_DEPRECATED_WARNINGS_SINCE=0x60000 -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x55f00 -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS_SINCE=0x60000 -DQT_DISABLE_DEPRECATED_BEFORE=0x50f02 -DQT_GUI_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_KEYWORDS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_URL_CAST_FROM_STRING -DQT_STRICT_ITERATORS -DQT_USE_QSTRINGBUILDER -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -Dkimg_psd_EXPORTS -I/var/tmp/portage/kde-frameworks/kimageformats-5.107.0/work/kimageformats-5.107.0_build/src/imageformats -I/var/tmp/portage/kde-frameworks/kimageformats-5.107.0/work/kimageformats-5.107.0/src/imageformats -I/var/tmp/portage/kde-frameworks/kimageformats-5.107.0/work/kimageformats-5.107.0_build/src/imageformats/kimg_psd_autogen/include -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++  -DQT_NO_DEBUG -march=native -O2 -pipe -flto=auto -fno-plt -fno-semantic-interposition -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,-O1 -Wl,--as-needed -fno-operator-names -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Werror=init-self -Werror=undef -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -pedantic -Wzero-as-null-pointer-constant -Wmissing-include-dirs -fdiagnostics-color=always -std=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -MD -MT src/imageformats/CMakeFiles/kimg_psd.dir/psd.cpp.o -MF src/imageformats/CMakeFiles/kimg_psd.dir/psd.cpp.o.d -o src/imageformats/CMakeFiles/kimg_psd.dir/psd.cpp.o -c /var/tmp/portage/kde-frameworks/kimageformats-5.107.0/work/kimageformats-5.107.0/src/imageformats/psd.cpp
/var/tmp/portage/kde-frameworks/kimageformats-5.107.0/work/kimageformats-5.107.0/src/imageformats/psd.cpp: In instantiation of ‘void {anonymous}::planarToChunchyFloat(uchar*, const char*, qint32, qint32, qint32) [with T = unsigned int; T min = 0; T max = 1; uchar = unsigned char; qint32 = int]’:
/var/tmp/portage/kde-frameworks/kimageformats-5.107.0/work/kimageformats-5.107.0/src/imageformats/psd.cpp:1143:50:   required from here
/var/tmp/portage/kde-frameworks/kimageformats-5.107.0/work/kimageformats-5.107.0/src/imageformats/psd.cpp:828:23: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  828 |         auto ftmp = (*reinterpret_cast<float*>(&tmp) - double(min)) / (double(max) - double(min));
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
Comment 1 Andreas Sturmlechner gentoo-dev 2023-07-25 11:10:19 UTC
Oh, fixed in commit e22db0940a068cc4c0e137d3e8247b368a5c8734 btw.