首页| 论坛| 消息

标题:Qt6中负数与char兼容问题
作者:mugua001
日期:2024-01-13 16:42
内容:

Qt5.8 可以编译通过,换成Qt6.6.1之后报这个错误。(AES加密函数中用到的数组)
error: constant expression evaluates to -14 which cannot be narrowed to type 'char'
---------------------------------------------
onst char sm_S[256] =
{ 99, 124, 119, 123, -14, 107, 111, -59, 48, 1, 103, 43, -2, -41, -85, 118, -54,......};


#1 [realfan 01-15 10:07]
char改成signed char试试
#2 回 realfan 的帖子 [mugua001 01-21 14:59]
realfan:char改成signed char试试 (2024-01-15 10:07) 
大神的方法果然 有效。
感谢~!!

回复 发表
主题 版块