Skip to content

Add stdint.h include to emitterutils.cpp#1450

Closed
taotieren wants to merge 1 commit into
jbeder:masterfrom
taotieren:patch-1
Closed

Add stdint.h include to emitterutils.cpp#1450
taotieren wants to merge 1 commit into
jbeder:masterfrom
taotieren:patch-1

Conversation

@taotieren

@taotieren taotieren commented Jun 22, 2026

Copy link
Copy Markdown
...
[406/1335] Building CXX object external/yaml/CMakeFiles/yaml-cpp.dir/src/emitterutils.cpp.o
FAILED: [code=1] external/yaml/CMakeFiles/yaml-cpp.dir/src/emitterutils.cpp.o 
/usr/bin/c++ -DYAML_CPP_NO_CONTRIB -DYAML_CPP_STATIC_DEFINE -I/build/qsoc-git/src/qsoc-git/build/external/yaml -I/build/qsoc-git/src/qsoc-git/external/yaml -I/build/qsoc-git/src/qsoc-git/build/external/yaml/yaml-cpp_autogen/include -I/build/qsoc-git/src/qsoc-git/external/yaml/include -I/build/qsoc-git/src/qsoc-git/external/yaml/src -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/qsoc-git/src=/usr/src/debug/qsoc-git -flto=auto -O3 -DNDEBUG -std=c++20 -fPIC -MD -MT external/yaml/CMakeFiles/yaml-cpp.dir/src/emitterutils.cpp.o -MF external/yaml/CMakeFiles/yaml-cpp.dir/src/emitterutils.cpp.o.d -o external/yaml/CMakeFiles/yaml-cpp.dir/src/emitterutils.cpp.o -c /build/qsoc-git/src/qsoc-git/external/yaml/src/emitterutils.cpp
/build/qsoc-git/src/qsoc-git/external/yaml/src/emitterutils.cpp:221:11: error: ‘uint16_t’ was not declared in this scope
  221 | std::pair<uint16_t, uint16_t> EncodeUTF16SurrogatePair(int codePoint) {
      |           ^~~~~~~~
/build/qsoc-git/src/qsoc-git/external/yaml/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"
/build/qsoc-git/src/qsoc-git/external/yaml/src/emitterutils.cpp:221:21: error: ‘uint16_t’ was not declared in this scope
  221 | std::pair<uint16_t, uint16_t> EncodeUTF16SurrogatePair(int codePoint) {
      |                     ^~~~~~~~
/build/qsoc-git/src/qsoc-git/external/yaml/src/emitterutils.cpp:221:21: note: ‘uint16_t’ is defined in header ‘<cstdint>; this is probably fixable by adding ‘#include <cstdint>’
/build/qsoc-git/src/qsoc-git/external/yaml/src/emitterutils.cpp:221:29: error: template argument 1 is invalid
  221 | std::pair<uint16_t, uint16_t> EncodeUTF16SurrogatePair(int codePoint) {
      |                             ^
/build/qsoc-git/src/qsoc-git/external/yaml/src/emitterutils.cpp:221:29: error: template argument 2 is invalid
...

@SGSSGene

Copy link
Copy Markdown
Collaborator

Thank you for your contribution.

cstdint is the correct c++ header for uint16_t. stdint.h is a c header and not required.

So I am assuming the issue must lie somwhere else. Could you report your gcc/clang version and which OS you are using?

@taotieren

Copy link
Copy Markdown
Author
❯ lsb_release -a
LSB Version:    n/a
Distributor ID: Arch
Description:    Arch Linux
Release:        rolling
Codename:       n/a
❯ uname -a
Linux 14s 7.0.12-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Wed, 10 Jun 2026 08:57:50 +0000 x86_64 GNU/Linux
❯ gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/16.1.1/lto-wrapper
目标:x86_64-pc-linux-gnu
配置为:/build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust,cobol --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror --disable-fixincludes
线程模型:posix
支持的 LTO 压缩算法:zlib zstd
gcc 版本 16.1.1 20260430 (GCC) 

After manually adding the stdint.h header file, the code compiles successfully.

@SGSSGene

SGSSGene commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

I believe you are using 0.8.0 or older and not the newest version 0.9.0 (or master branch). This issue has been fixed:
7b469b4

@taotieren

taotieren commented Jun 22, 2026

Copy link
Copy Markdown
Author

I believe you are using 0.8.0 or older and not the newest version 0.9.0 (or master branch). This issue has been fixed: 7b469b4

Yes. I just checked the version of yaml-cpp used by the upstream repo and it needs to be upgraded to 0.9.0 or above. Thanks a lot.

@taotieren taotieren closed this Jun 22, 2026
@SGSSGene

Copy link
Copy Markdown
Collaborator

Thank you for forwarding it to qsoc !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants