[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Use 'return' from main() instead of calling exit()

From: Bob Proulx
Subject: Re: [PATCH] Use 'return' from main() instead of calling exit()
Date: Sat, 23 Oct 2004 13:14:15 -0600
User-agent: Mutt/1.5.6+20040907i

Petter Reinholdtsen wrote:
> Here is a patch for findutils 4.1.20 to avoid warnings from the
> compiler about unreachable code.  It changes all calls to exit() in
> main() to use the 'return' statement instead.  Please include in a
> future version of findutils.
> [...]
> -  exit (exit_status);
> +  return (exit_status);

Consider that return is a keyword, not a function, and parentheses
around the value are not required.  They just make return look like a
function and it is not.  I know you simply converted the exits to
returns and probably missed that.

-  exit (exit_status);
+  return exit_status;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]