https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104605
Bug ID: 104605 Summary: _GLIBCXX_USE_C99_STDINT_TR1 macro is not defined for canadian cross freestanding C++ toolchain Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: unlvsur at live dot com Target Milestone: --- #include<cstdint> int main() { std::uintptr_t p{}; } This code works on x86_64-elf cross toolchain on linux, but fails to work after i perform Canadian cross-compilation from linux to windows since _GLIBCXX_USE_C99_STDINT_TR1 is not defined. Also stdint.h in GCC is not correctly defined without -ffreestanding flag. I believe it can be trivialized as just do this #if __has_include_next(<stdint.h>) # include_next <stdint.h> #else # include "stdint-gcc.h" #endif