代码拉取完成,页面将自动刷新
【任务描述】
../../base/account/os_account/services/accountmgr/src/ohos_account_data_deal.cpp:86:56: error: format specifies type 'long' but the argument has type 'std::time_t' (aka 'long long') [-Werror,-Wformat]
ACCOUNT_LOGI("AccountInfo, bindTime: %{public}ld", accountInfo.bindTime_);
~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
%lld
time_t 这个类型libc有两种宽度定义,一些系统是32bit,一些是64bit,这个根据
基础库的兼容方案,兼容不同os可能会变化,不能假定bindTime_一定是32位的,请修改
【解决方案】
建议修改方案采用%lld,并且在后面这个参数上加上(long long)accountInfo.bindTime_
【任务来源】
timeval的测试用例无法通过,libc的定义与kernel的不匹配,需要按照kernel的要求使用64位版本
libc会revert之前liteos上的修改,导致这个代码编译不过
登录 后才可以发表评论