typedef重定义-编译报错

文章描述了在u-boot源代码中遇到的关于`uintptr_t`typedef冲突的报错,给出了在hvb_cert.c文件中修改typedef以解决编译问题的方法,涉及包括#include<fdtdec.h>的头文件和对uintptr_t的重新定义。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 报错日志:
sprd_UNC_LINUX_YOCTO_SL8541E/source/bsp/u-boot15_sprdroidq/lib/libhvb/hvb_cert.c:20:
sprd_UNC_LINUX_YOCTO_SL8541E/build-unisoc-wayland/tmp-unisoc_wayland-glibc/work/sl8541e_emmc_marlin2-unisoc-linux-gnueabi/u-boot15/v2015.07+git999-r0/recipe-sysroot-native/usr/lib/arm-unisoc-linux-gnueabi/gcc/arm-unisoc-linux-gnueabi/7.2.1/include/stdint-gcc.h:86:26: error: conflicting types for 'uintptr_t'
 typedef __UINTPTR_TYPE__ uintptr_t;
                          ^~~~~~~~~
sprd_UNC_LINUX_YOCTO_SL8541E/source/bsp/u-boot15_sprdroidq/lib/libhvb/hvb_cert.c:16:
sprd_UNC_LINUX_YOCTO_SL8541E/source/bsp/u-boot15_sprdroidq/include/compiler.h:120:27: note: previous declaration of 'uintptr_t' was here
 typedef unsigned long int uintptr_t;
                           ^~~~~~~~~

解决方法:
在source/bsp/u-boot15_sprdroidq/lib/libhvb/hvb_cert.c中

#define uintptr_t wyh_uintptr_t

#include <fdtdec.h>

#undef uintptr_t

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值