On Tuesday 29 August 2006 20:08, stephan beal wrote:
On Tuesday 29 August 2006 19:55, Marc Collin wrote:
/home/collinm/Download/nvidia/forcedeth.c: In function ‘nv_set_sg’: /home/collinm/Download/nvidia/forcedeth.c:3886: warning: control reaches end of non-void function
This warning comes from incorrectly-written code. If you let this warning go the driver will have "undefined behaviour". You can edit the code and maybe find the proper return value for nv_set_sg(), and add the proper 'return' statement there. The problem is that the function is declared as returning a value but does not actually do so.
I haven't seen the actual code, but it doesn't have to be incorrect. gcc doesn't do much in the way of logic analysis, and for example int foo(){ int i; i = 1; if(i) return 0; } will also generate the error. gcc just doesn't see that even if all possible code paths don't return something, all logically accessible paths do Of course this puts more responsibility on the programmer to make sure that he hasn't missed a code path. But it doesn't have to be an actual error