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

Bug 937412

Summary: dev-cpp/yaml-cpp-0.8.0: [gcc-15] error: ‘uint16_t’ was not declared in this scope
Product: Gentoo Linux Reporter: tdr <ted.d.rodgers>
Component: Current packagesAssignee: Alexey <alexey+gentoo>
Status: UNCONFIRMED ---    
Severity: normal CC: proxy-maint, ted.d.rodgers
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/jbeder/yaml-cpp/issues/1307
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 932474    
Attachments: build fail
include <cstdint> patch
build log (successful)
info
include fix

Description tdr 2024-08-05 23:55:27 UTC
package failed with gcc:15 on emitterutils.cpp with multiple messages:

    error: ‘uint16_t’ was not declared in this scope emitterutils.cpp 
    +
    note: ‘uint16_t’ is defined in header ‘<cstdint>’

Reproducible: Always

Steps to Reproduce:
enable gcc:15 compiler

emerge =yaml-cpp-0.8.0 
Actual Results:  
var/tmp/portage/dev-cpp/yaml-cpp-0.8.0/work/yaml-cpp-0.8.0/src/emitterutils.cpp:13:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   12 | #include "yaml-cpp/null.h"
  +++ |+#include <cstdint>
   13 | #include "yaml-cpp/ostream_wrapper.h"
/var/tmp/portage/dev-cpp/yaml-cpp-0.8.0/work/yaml-cpp-0.8.0/src/emitterutils.cpp:221:21: error: ‘uint16_t’ was not declared in this scope
  221 | std::pair<uint16_t, uint16_t> EncodeUTF16SurrogatePair(int codePoint) {
      |                     ^~~~~~~~
/var/tmp/portage/dev-cpp/yaml-cpp-0.8.0/work/yaml-cpp-0.8.0/src/emitterutils.cpp:221:21: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
/var/tmp/portage/dev-cpp/yaml-cpp-0.8.0/work/yaml-cpp-0.8.0/src/emitterutils.cpp:221:29: error: template argument 1 is invalid
  221 | std::pair<uint16_t, uint16_t> EncodeUTF16SurrogatePair(int codePoint) {
      |                             ^
/var/tmp/portage/dev-cpp/yaml-cpp-0.8.0/work/yaml-cpp-0.8.0/src/emitterutils.cpp:221:29: error: template argument 2 is invalid
/var/tmp/portage/dev-cpp/yaml-cpp-0.8.0/work/yaml-cpp-0.8.0/src/emitterutils.cpp: In function ‘int YAML::Utils::{anonymous}::EncodeUTF16SurrogatePair(int)’:
/var/tmp/portage/dev-cpp/yaml-cpp-0.8.0/work/yaml-cpp-0.8.0/src/emitterutils.cpp:222:9: error: ‘uint32_t’ does not name a type
  222 |   const uint32_t leadOffset = 0xD800 - (0x10000 >> 10);


patching src/emitterutils.cpp to add the missing header and allows gcc:15 to compile the package



--- a/src/emitterutils.cpp
+++ b/src/emitterutils.cpp
@@ -1,4 +1,5 @@
 #include <algorithm>
+#include <cstdint>
 #include <iomanip>
 #include <sstream>
 #include "emitterutils.h"


 * ===================================================================================================================================================================================================
 * Applying user patches from /etc/portage/patches ...
 * Applying yaml-cpp-0.8.0-gcc15-fix.patch ...
patching file src/emitterutils.cpp
Hunk #1 succeeded at 1 with fuzz 1.                                                                                                                                                            [ ok ]
 * User patches applied.
Comment 1 tdr 2024-08-05 23:56:05 UTC
Created attachment 899183 [details]
build fail
Comment 2 tdr 2024-08-05 23:57:01 UTC
Created attachment 899184 [details, diff]
include <cstdint> patch
Comment 3 tdr 2024-08-05 23:57:28 UTC
Created attachment 899185 [details]
build log (successful)
Comment 4 tdr 2024-08-06 00:00:24 UTC
Created attachment 899186 [details]
info
Comment 5 tdr 2024-08-06 02:30:02 UTC
Created attachment 899187 [details, diff]
include fix