可以运行但是control reaches end of non-void function [-Wreturn-type]
int checkf(char* a)
{
int i;
for(i=0;i<=strlen(a);i++)
{
if(a[i] == '.' && a[i+1] == '.')
{
return 1;
}
else if(a[i] == '.' && a[i+1] == '-')
{
return 1;
}
else if(a[i] == '.' && a[i+1] == '')
{
return 1;
}
else if(a[i] == '-' && a[i+1] == '.')
{
return 1;
}
else if(a[i] == '-' && a[i+1] == '-')
{
return 1;
}
else if(a[i] == '-' && a[i+1] == '')
{
return 1;
}
else if(a[i] == '' && a[i+1] == '.')
{
return 1;
}
else if(a[i] == '' && a[i+1] == '-')
{
return 1;
}
else if(a[i] == '' && a[i+1] == '')
{
return 1;
}
else
{
return 0;
}
}
}
control reaches end of non-void function [-Wreturn-type]
检查一下是否每个控制流都会有返回值,不过一般都是warning不影响程序的执行