Closed
[Bug-Report|缺陷反馈]: pre_def.h missing <cstdint> causes compilation failure after GCC upgrade #3172
hsqnbAdd on  Aug 31Closed at  Sep 3
hsqnb
hsqnbCollaborators
Aug 31 Create

Describe the current behavior / 问题描述 (Mandatory / 必填)

After upgrading GCC, compiling framework/src/interface/inner/pre_def.h fails because uint8_t (used by the BinDataPtr typedef on line 38) is not defined. The newer GCC no longer transitively includes <cstdint> through other headers (e.g. <vector>/<memory>), so the definition of uint8_t is missing, causing a build break on strict toolchains.

Environment / 环境信息 (Mandatory / 必填)

  • 服务器/NPU 型号: Ascend 910B
  • PyPTO 版本/Commit: deb1fdc16
  • CANN 版本: 8.x
  • Python 版本: 3.10
  • 操作系统: Ubuntu 22.04
  • GCC 版本: (升级后版本,如 13.x)

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

  1. Upgrade GCC to a stricter version (e.g. 13+)
  2. Build the framework component that includes pre_def.h
  3. Observe compilation error: error: 'uint8_t' does not name a type at BinDataPtr = uint8_t*;

Describe the expected behavior / 预期结果 (Mandatory / 必填)

pre_def.h should compile successfully by explicitly including <cstdint> so that uint8_t is always defined regardless of whether other headers transitively include it.

framework/src/interface/inner/pre_def.h:38:18: error: 'uint8_t' does not name a type
38 | using BinDataPtr = uint8_t*;
| ^ ~~~~~~~

likedislike
hsqnbhsqnbCollaborators
Aug 31 Associated pull request
hsqnbhsqnbCollaborators
Aug 31 Assign hsqnb as responsible person
hsqnbhsqnbCollaborators
Sep 1 changed custom state from 待办的 to 已完成
hsqnbhsqnbCollaborators
Sep 1 Close issue
CANN-robotCANN-robotCollaborators
Sep 1 Added label: resolved
hsqnbhsqnbCollaborators
Sep 2 changed custom state from 已完成 to 待办的
hsqnbhsqnbCollaborators
Sep 2 Reopen issue
hsqnbhsqnbCollaborators
Sep 2 Associated pull request
CANN-robotCANN-robotCollaborators
Sep 3 Close issue