https://bugs.kde.org/show_bug.cgi?id=471829

            Bug ID: 471829
           Summary: kimageformats 5.107.0 build failure:
                    src/imageformats/psd.cpp:828:23: error: dereferencing
                    type-punned pointer will break strict-aliasing rules
                    [-Werror=strict-aliasing]
    Classification: Frameworks and Libraries
           Product: frameworks-kimageformats
           Version: 5.107.0
          Platform: Gentoo Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: alex.me...@kde.org
          Reporter: koce...@tutanota.com
                CC: aa...@kde.org, kdelibs-b...@kde.org
  Target Milestone: ---

Created attachment 160020
  --> https://bugs.kde.org/attachment.cgi?id=160020&action=edit
complete build log

SUMMARY
kimageformats 5.107.0 fails to compile with -Werror=strict-aliasing 

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 -O2 -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


STEPS TO REPRODUCE
1. Add -Werror=strict-aliasing to CXXFLAGS
2. Try to build
3. Build failure

SOFTWARE/OS VERSIONS
Gentoo Linux 2.13
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
GCC version: Gentoo 13.1.1_p20230527

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to