bug-bash
[Top][All Lists]
Advanced

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

control may reach end of non-void function


From: Tim Waugh
Subject: control may reach end of non-void function
Date: Tue, 8 Mar 2005 13:21:14 +0000
User-agent: Mutt/1.4.2.1i

Hi,

In bash-3.0, bashline.c gives this warning during compilation:

bashline.c:1418: warning: control may reach end of non-void function
'bash_directory_expansion' being inlined

Since that function is only used once, and in that instance the return
value is not examined---and since there are no return statements in the
function at all---perhaps it should have its return type changed from
int to void.

Tim.
*/

--- bash-3.0/bashline.c.badcode 2005-03-08 13:16:39.000000000 +0000
+++ bash-3.0/bashline.c 2005-03-08 13:17:56.000000000 +0000
@@ -100,7 +100,7 @@
 #endif
 
 /* Helper functions for Readline. */
-static int bash_directory_expansion __P((char **));
+static void bash_directory_expansion __P((char **));
 static int bash_directory_completion_hook __P((char **));
 static int filename_completion_ignore __P((char **));
 static int bash_push_line __P((void));
@@ -2200,7 +2200,7 @@
 /* Simulate the expansions that will be performed by
    rl_filename_completion_function.  This must be called with the address of
    a pointer to malloc'd memory. */
-static int
+static void
 bash_directory_expansion (dirname)
      char **dirname;
 {




reply via email to

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