daemonize icon indicating copy to clipboard operation
daemonize copied to clipboard

no-return-in-nonvoid-function

Open saigkill opened this issue 12 years ago • 2 comments

I'm getting this after a build on openSUSE. Does anyone knows how to fix it?

I: Program is using implicit definitions of functions getting pointers or implemented by macros. These functions need to use their correct prototypes to allow correct argument passing on e.g. x86_64 .

  • Implicit memory/string functions need #include <string.h>.
  • Implicit *printf functions need #include <stdio.h>.
  • Implicit *printf functions need #include <stdio.h>.
  • Implicit read functions need #include <unistd.h>.
  • Implicit recv functions need #include <sys/socket.h>. W: daemonize implicit-pointer-decl daemonize.c:283

I: Program returns random data in a function E: daemonize no-return-in-nonvoid-function daemonize.c:531

I: Program returns random data in a function E: daemonize no-return-in-nonvoid-function daemonize.c:531

saigkill avatar Dec 08 '13 20:12 saigkill

I think this is a fairly quick fix. I'll try to get to it tonight.

bmc avatar Dec 08 '13 21:12 bmc

It's tested. That one works:


Index: daemonize.c
===================================================================
--- daemonize.c.orig
+++ daemonize.c
@@ -523,6 +523,12 @@ int main(int argc, char **argv)
     execvp(cmd[0], cmd);
 
     die("Can't exec \"%s\": %s\n", cmd[0], strerror (errno));
+
+    /* Make sure there's a return value, so compiler doesn't complain
+     * Patch by Sascha Manns , 09 December 2013
+    */
+    return 0;
+
 }
 
 /*  vim: set et sw=4 sts=4 : */

saigkill avatar Dec 09 '13 18:12 saigkill