编译uboot时遇到问题:hush.c:2744:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
找出源文件并打开:
~/test/u-boot-2012.04.01$ find -name hush.c
./common/hush.c
~/test/u-boot-2012.04.01$ vim ./common/hush.c +2744
发现是程序对齐错误
static char *lookup_param(char *src)
{
char *p;
if (!src)
return NULL;
p = getenv(src);
if (!p)
p = get_local_var(src);
return p;
}
修改为:
static char *lookup_param(char *src)
{
char *p;
if (!src)
return NULL;
p = getenv(src);
if (!p)
p = get_local_var(src);
return p;
}
done
参考:gcc编译警告关于(warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if(err)之类的问题)