Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typedef declaration of size_t in tgc::hash class triggers error in gcc13 env. #4738

Closed
grillo-delmal opened this issue Feb 6, 2023 · 1 comment
Labels

Comments

@grillo-delmal
Copy link
Contributor

grillo-delmal commented Feb 6, 2023

Description

This bug was reported to me by the Fedora build system when rebuilding packages for the next version of the distro[0], which uses gcc13.

Honestly, I don't know if they added new flags that makes builds more strict or if it's because of the gcc version change, but this is the error message that it shows when building v1.6.0 and the latest commit onf F38.

/opt/toonz/toonz/sources/include/tcg/hash.h:37:50: error: declaration of 'typedef typename tcg::list<tcg::hash<K, T, Hash_functor>::BucketNode>::size_t tcg::hash<K, T, Hash_functor>::size_t' changes meaning of 'size_t' [-fpermissive]
   37 |   typedef typename tcg::list<BucketNode>::size_t size_t;
      |                                                  ^~~~~~
/opt/toonz/toonz/sources/include/tcg/hash.h:28:5: note: used here to mean 'typedef long unsigned int size_t'
   28 |     size_t m_prev;
      |     ^~~~~~

I searched about this message and found the following Stack Overflow thread [1] that explains why it happens.

I already prepared a simple patch for Fedora for it though, so I'll upstream it soon.

[0] https://koji.fedoraproject.org/koji/taskinfo?taskID=96384858
[1] https://stackoverflow.com/questions/12187549/typedef-changes-meaning

Steps to Reproduce

  1. Boot up a Fedora 36+
  2. sudo dnf install fedpkg
  3. fedpkg clone opentoonz
  4. cd opentoonz
  5. git checkout f37
  6. fedpkg --release f38 mockbuild

Expected Behavior

I expect it to build without problems, as it did on Fedora 37

Screenshots, Video & Crash Logs

[  6%] Building CXX object tnzcore/CMakeFiles/tnzcore.dir/__/common/trop/tdespeckle.cpp.o
cd /opt/out/tnzcore && /usr/bin/c++ -DLINUX -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SHARED -DQT_WIDGETS_LIB -DTCOLOR_EXPORTS -DTFLASH_EXPORTS -DTGEOMETRY_EXPORTS -DTGL_EXPORTS -DTIMAGE_EXPORTS -DTIMAGE_IO_EXPORTS -DTNZCORE_EXPORTS -DTNZ_LITTLE_ENDIAN=1 -DTRASTERIMAGE_EXPORTS -DTRASTER_EXPORTS -DTROP_EXPORTS -DTSOUND_EXPORTS -DTSTREAM_EXPORTS -DTSYSTEM_EXPORTS -DTVECTORIMAGE_EXPORTS -DTVRENDER_EXPORTS -Dtnzcore_EXPORTS -Dx64 -I/opt/out/tnzcore -I/opt/toonz/toonz/sources/tnzcore -I/opt/toonz/toonz/sources/include -isystem /opt/toonz/toonz/sources/BEFORE -isystem /usr/include/libusb-1.0 -isystem /usr/include/SuperLU -isystem /usr/include/libmypaint -isystem /usr/include/json-c -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -isystem /usr/include/sysprof-4 -isystem /opt/toonz/toonz/sources/tnzcore/../common/flash -isystem /opt/toonz/thirdparty/Lz4/Lz4_131/lib -isystem /usr/include/freetype2 -isystem /usr/include/libpng16 -isystem /usr/include/harfbuzz -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtOpenGL -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtMultimedia -Wwrite-strings -Wundef -Wmissing-declarations  -std=c++11 -lstdc++ -DNDEBUG -fPIC -fPIC -std=gnu++11 -MD -MT tnzcore/CMakeFiles/tnzcore.dir/__/common/trop/tdespeckle.cpp.o -MF CMakeFiles/tnzcore.dir/__/common/trop/tdespeckle.cpp.o.d -o CMakeFiles/tnzcore.dir/__/common/trop/tdespeckle.cpp.o -c /opt/toonz/toonz/sources/common/trop/tdespeckle.cpp
In file included from /opt/toonz/toonz/sources/include/tbigmemorymanager.h:19,
                 from /opt/toonz/toonz/sources/include/traster.h:11,
                 from /opt/toonz/toonz/sources/include/trastercm.h:6,
                 from /opt/toonz/toonz/sources/include/trop.h:3,
                 from /opt/toonz/toonz/sources/include/tropcm.h:6,
                 from /opt/toonz/toonz/sources/common/trop/tdespeckle.cpp:3:
/opt/toonz/toonz/sources/include/tthreadmessage.h: In constructor 'TThread::Mutex::Mutex()':
/opt/toonz/toonz/sources/include/tthreadmessage.h:87:37: warning: 'QMutex::QMutex(RecursionMode)' is deprecated: Use QRecursiveMutex instead of a recursive QMutex [-Wdeprecated-declarations]
   87 |   Mutex() : QMutex(QMutex::Recursive) {}
      |                                     ^
In file included from /usr/include/qt5/QtCore/QMutex:1,
                 from /opt/toonz/toonz/sources/include/tthreadmessage.h:12:
/usr/include/qt5/QtCore/qmutex.h:159:14: note: declared here
  159 |     explicit QMutex(RecursionMode mode);
      |              ^~~~~~
In file included from /opt/toonz/toonz/sources/include/tcg/tcg_hash.h:3,
                 from /opt/toonz/toonz/sources/common/trop/borders_extractor.hpp:12,
                 from /opt/toonz/toonz/sources/common/trop/borders_extractor.h:100,
                 from /opt/toonz/toonz/sources/common/trop/tdespeckle.cpp:14:
/opt/toonz/toonz/sources/include/tcg/hash.h: At global scope:
/opt/toonz/toonz/sources/include/tcg/hash.h:37:50: error: declaration of 'typedef typename tcg::list<tcg::hash<K, T, Hash_functor>::BucketNode>::size_t tcg::hash<K, T, Hash_functor>::size_t' changes meaning of 'size_t' [-fpermissive]
   37 |   typedef typename tcg::list<BucketNode>::size_t size_t;
      |                                                  ^~~~~~
/opt/toonz/toonz/sources/include/tcg/hash.h:28:5: note: used here to mean 'typedef long unsigned int size_t'
   28 |     size_t m_prev;
      |     ^~~~~~
In file included from /usr/include/wchar.h:35,
                 from /usr/include/c++/13/cwchar:44,
                 from /usr/include/c++/13/bits/postypes.h:40,
                 from /usr/include/c++/13/bits/char_traits.h:42,
                 from /usr/include/c++/13/string:42,
                 from /opt/toonz/toonz/sources/include/tcommon.h:26,
                 from /opt/toonz/toonz/sources/include/tutil.h:6,
                 from /opt/toonz/toonz/sources/include/traster.h:6:
/usr/lib/gcc/x86_64-redhat-linux/13/include/stddef.h:214:23: note: declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
make[2]: *** [tnzcore/CMakeFiles/tnzcore.dir/build.make:1241: tnzcore/CMakeFiles/tnzcore.dir/__/common/trop/tdespeckle.cpp.o] Error 1
make[2]: Leaving directory '/opt/out'
make[1]: *** [CMakeFiles/Makefile2:455: tnzcore/CMakeFiles/tnzcore.dir/all] Error 2
make[1]: Leaving directory '/opt/out'
make: *** [Makefile:139: all] Error 2

OpenToonz Version

1.6

OpenToonz Version Information

Also reproducible on the latest nightly

Operating System

Linux

GPU

NVIDIA

Graphics Tablet

None

@grillo-delmal
Copy link
Contributor Author

This was resolved by #4739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant