小编dea*_*zvi的帖子

警告 - 整数运算结果超出c的范围

我正在使用RVCT编译器在C中编译此代码(此处的相关部分):

static void Test (void)
{
     unsigned long regVal;
     regVal |= (UINT32)(    (0x1 << 31)     |
                            (0x1 << 26)     |
                             0x3E);
}
Run Code Online (Sandbox Code Playgroud)

编译代码时,我收到以下警告警告:"#61-D:整数运算结果超出范围".

我想了解要改变什么以避免警告.

先感谢您!

c gcc

6
推荐指数
1
解决办法
2719
查看次数

尽管文件存在,但 dlopen 返回文件未找到

我正在使用以下代码 -

pxSFunc->handle = dlopen(psFilePath, RTLD_LAZY);
if (!pxSFunc->handle) {
     printf("%s Ignored loading the lib: %s\n", dlerror(), psFilePath);
Run Code Online (Sandbox Code Playgroud)

psFilePath 指向有效路径(可读和可访问)的位置。

运行此部分后,我收到以下错误:

File not found Ignored loading the lib: /usr/lib/libnetwork.so
Run Code Online (Sandbox Code Playgroud)

我想知道应该使用什么调试工具来调试这个问题?

我将所有相关路径添加到 LD_LIBRARY_PATH,并且在这个库上运行 'ldd' 没有显示任何问题。也许有人对这个问题与什么有关有什么想法?

谢谢大家!

c linux

2
推荐指数
1
解决办法
2170
查看次数

错误使用国家条件

我使用以下代码检查位数25值是0还是1:

volatile unsigned int * regAddr;
unsigned int regval;

regAddress = (unsigned int *) 0xD2009010;   //This is a valid address of register

regVal = *regAddress;   //The return value here is 0xFE008000

if (!(regVal & 0x4000000))     //For the mentioned return value, I thought the condition will be different then 0 and so used '!' to convert the value
    the bit is 0;
else
    the bit is 1;
Run Code Online (Sandbox Code Playgroud)

此代码无法正常工作,我无法弄清楚原因.帮助任何人?提前致谢

c

-3
推荐指数
1
解决办法
154
查看次数

标签 统计

c ×3

gcc ×1

linux ×1