嵌入式 编译gdb源码时出现“set but not used [-Werror=unused-but-set-variable]”问题的解决办

查看具体是那个C文件,然后到该C文件所在目录下找Makefile,找到“-Werror”字段,把“-Werror”字段进行删除即可!

 

例子:

arm-dis.c:2155:9: error: format not a string literal and no format arguments [-Werror=format-security]
arm-dis.c:2162:9: error: format not a string literal and no format arguments [-Werror=format-security]

解决方案:

root@u12d32:/home/kongjun/work/gdb_qy_test/gdb-6.4#
root@u12d32:/home/kongjun/work/gdb_qy_test/gdb-6.4# find -name arm-dis.c
./opcodes/arm-dis.c
root@u12d32:/home/kongjun/work/gdb_qy_test/gdb-6.4#

 

把“-Werror”直接删除,其他不变即可!

 

你可能感兴趣的:(嵌入式)