Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 937412 - dev-cpp/yaml-cpp-0.8.0: [gcc-15] error: ‘uint16_t’ was not declared in this scope
Summary: dev-cpp/yaml-cpp-0.8.0: [gcc-15] error: ‘uint16_t’ was not declared in this s...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Alexey
URL:
Whiteboard:
Keywords: PATCH, PullRequest
: 937557 (view as bug list)
Depends on:
Blocks: gcc-15
  Show dependency tree
 
Reported: 2024-08-05 23:55 UTC by tdr
Modified: 2024-08-15 14:07 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build fail (yaml-cpp-0.8.0-build-failure.log,27.60 KB, text/plain)
2024-08-05 23:56 UTC, tdr
Details
include <cstdint> patch (yaml-cpp-0.8.0-gcc15-fix.patch,35.74 KB, patch)
2024-08-05 23:57 UTC, tdr
Details | Diff
build log (successful) (yaml-cpp-0.8.0-build-successful.log,35.73 KB, text/plain)
2024-08-05 23:57 UTC, tdr
Details
info (emerge--info.txt,6.10 KB, text/plain)
2024-08-06 00:00 UTC, tdr
Details
include fix (yaml-cpp-0.8.0-gcc15-fix.patch,178 bytes, patch)
2024-08-06 02:30 UTC, tdr
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
Comment 6 Toralf Förster gentoo-dev 2024-08-08 07:00:27 UTC
*** Bug 937557 has been marked as a duplicate of this bug. ***
Comment 7 Larry the Git Cow gentoo-dev 2024-08-15 14:07:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75c4eaca10479779ec6ef97d4f583d49e808ccfe

commit 75c4eaca10479779ec6ef97d4f583d49e808ccfe
Author:     Christopher Fore <csfore@posteo.net>
AuthorDate: 2024-08-15 13:59:39 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-08-15 14:06:25 +0000

    dev-cpp/yaml-cpp: Fix compilation on GCC 15
    
    - Include patch from upstream PR (refer to patch file)
    - Tests pass
    
    Closes: https://bugs.gentoo.org/937412
    Signed-off-by: Christopher Fore <csfore@posteo.net>
    Closes: https://github.com/gentoo/gentoo/pull/38163
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/yaml-cpp-0.8.0-include-cstdint.patch     | 33 ++++++++++++++++++++++
 dev-cpp/yaml-cpp/yaml-cpp-0.8.0.ebuild             |  3 +-
 2 files changed, 35 insertions(+), 1 deletion(-)