Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

FTBFS with GCC 13 #2954

Open
marxin opened this issue Jul 1, 2022 · 2 comments
Open

FTBFS with GCC 13 #2954

marxin opened this issue Jul 1, 2022 · 2 comments
Labels

Comments

@marxin
Copy link

marxin commented Jul 1, 2022

Fails with:

[   18s] [  4%] Building CXX object samples/sample_common/CMakeFiles/sample_common.dir/src/d3d_allocator.cpp.o
[   18s] /home/abuild/rpmbuild/BUILD/MediaSDK-intel-mediasdk-21.3.5/api/mfx_dispatch/linux/mfxparser.cpp: In function 'std::string MFX::printCodecId(mfxU32)':
[   18s] /home/abuild/rpmbuild/BUILD/MediaSDK-intel-mediasdk-21.3.5/api/mfx_dispatch/linux/mfxparser.cpp:60:3: error: 'uint8_t' was not declared in this scope
[   18s]    60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
[   18s]       |   ^~~~~~~
[   18s] /home/abuild/rpmbuild/BUILD/MediaSDK-intel-mediasdk-21.3.5/api/mfx_dispatch/linux/mfxparser.cpp:29:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
[   18s]    28 | #include "mfxloader.h"
[   18s]   +++ |+#include <cstdint>
[   18s]    29 | 
[   18s] /home/abuild/rpmbuild/BUILD/MediaSDK-intel-mediasdk-21.3.5/api/mfx_dispatch/linux/mfxparser.cpp:60:12: error: 'data' was not declared in this scope
[   18s]    60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
[   18s]       |            ^~~~
[   18s] /home/abuild/rpmbuild/BUILD/MediaSDK-intel-mediasdk-21.3.5/api/mfx_dispatch/linux/mfxparser.cpp:60:36: error: 'uint8_t' does not name a type
[   18s]    60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
[   18s]       |                                    ^~~~~~~

due to:
https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes

@marxin marxin added the bug label Jul 1, 2022
@rathann
Copy link
Contributor

rathann commented Jan 17, 2023

Seeing this on Fedora development branch now. I'll provide a PR to fix this soon if nobody beats me to it.

@marxin
Copy link
Author

marxin commented Jan 17, 2023

Thank you, please do that.

rathann added a commit to rathann/MediaSDK that referenced this issue Jan 18, 2023
Prior to gcc-13 various C++ headers in gcc included `<cstdint>` even
though it was not strictly necessary; this results in the compiler
having to parse unnecessary code and thus slows down compilation for
everyone.  Those unnecessary #includes of `<cstdint>` have been removed
and applications which need the `<cstdint>` header file need to
explicitly include it.

Without the patch, when compiling with gcc-13 you will get this error:

/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp: In function 'std::string MFX::printCodecId(mfxU32)':
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:3: error: 'uint8_t' was not declared in this scope
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |   ^~~~~~~
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:29:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
   28 | #include "mfxloader.h"
  +++ |+#include <cstdint>
   29 |
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:12: error: 'data' was not declared in this scope
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |            ^~~~
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:36: error: 'uint8_t' does not name a type
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                    ^~~~~~~
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:36: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:43: error: expected '>' before '*' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                           ^
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:43: error: expected '(' before '*' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                           ^
      |                                           (
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:44: error: expected primary-expression before '>' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                            ^
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:50: error: expected ')' before ';' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                                  ^
      |                                                  )

Fixes issue Intel-Media-SDK#2954 .
rathann added a commit to rathann/MediaSDK that referenced this issue Jan 18, 2023
Prior to gcc-13 various C++ headers in gcc included `<cstdint>` even
though it was not strictly necessary; this results in the compiler
having to parse unnecessary code and thus slows down compilation for
everyone.  Those unnecessary #includes of `<cstdint>` have been removed
and applications which need the `<cstdint>` header file need to
explicitly include it.

Without the patch, when compiling with gcc-13 you will get this error:

```
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp: In function 'std::string MFX::printCodecId(mfxU32)':
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:3: error: 'uint8_t' was not declared in this scope
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |   ^~~~~~~
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:29:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
   28 | #include "mfxloader.h"
  +++ |+#include <cstdint>
   29 |
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:12: error: 'data' was not declared in this scope
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |            ^~~~
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:36: error: 'uint8_t' does not name a type
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                    ^~~~~~~
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:36: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:43: error: expected '>' before '*' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                           ^
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:43: error: expected '(' before '*' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                           ^
      |                                           (
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:44: error: expected primary-expression before '>' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                            ^
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:50: error: expected ')' before ';' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                                  ^
      |                                                  )
```

Fixes issue Intel-Media-SDK#2954 .
rathann added a commit to rathann/MediaSDK that referenced this issue Apr 19, 2023
Prior to gcc-13 various C++ headers in gcc included `<cstdint>` even
though it was not strictly necessary; this results in the compiler
having to parse unnecessary code and thus slows down compilation for
everyone.  Those unnecessary #includes of `<cstdint>` have been removed
and applications which need the `<cstdint>` header file need to
explicitly include it.

Without the patch, when compiling with gcc-13 you will get this error:

```
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp: In function 'std::string MFX::printCodecId(mfxU32)':
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:3: error: 'uint8_t' was not declared in this scope
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |   ^~~~~~~
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:29:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
   28 | #include "mfxloader.h"
  +++ |+#include <cstdint>
   29 |
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:12: error: 'data' was not declared in this scope
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |            ^~~~
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:36: error: 'uint8_t' does not name a type
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                    ^~~~~~~
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:36: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:43: error: expected '>' before '*' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                           ^
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:43: error: expected '(' before '*' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                           ^
      |                                           (
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:44: error: expected primary-expression before '>' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                            ^
/builddir/build/BUILD/MediaSDK-intel-mediasdk-22.6.4/api/mfx_dispatch/linux/mfxparser.cpp:60:50: error: expected ')' before ';' token
   60 |   uint8_t* data = reinterpret_cast<uint8_t*>(&id);
      |                                                  ^
      |                                                  )
```

Fixes issue Intel-Media-SDK#2954 .
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants