1、warning: control reaches end of non-void function
用gcc编译一个程序的时候出现这样的警告:
warning: control reaches end of non-void function
它的意思是:控制到达非void函数的结尾。就是说你的一些本应带有返回值的函数到达结尾后可能并没有返回任何值。这时候,最好检查一下是否每个控制流都会有返回值。
2、warning: passing argument 4 of 'snd_pcm_hw_params_set_rate' makes integer from pointer without a cast [-Wint-conversion]
它的意思是:传入 “snd_pcm_hw_params_set_rate” 的参数4将使指针为整数,而不进行转换[-Wint-conversion]。就是说函数的第四个参数应该传入整数,但是现在传入了一个指针,并且未进行类型转换。
3、warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
strncpy(cardName, pcmMgr->cardName, sizeof(pcmMgr->cardName)); 应该为 strncpy(cardName, pcmMgr->cardName, sizeof(cardName));
4、warning: assignme