lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [03/14] lucy-clownfish git commit: Avoid `uninitialized` warning within TRY block.
Date Sun, 20 Mar 2016 05:53:57 GMT
Avoid `uninitialized` warning within TRY block.

The compiler can't tell that either the TRY block will assign to
`retvalCF` successfully or an error will be detected before we return
it.  Therefore, assign an initial value to quiet the warning.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/f35c02d9
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/f35c02d9
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/f35c02d9

Branch: refs/heads/master
Commit: f35c02d96610e8f1fef0ed396650a1b498a1d138
Parents: b71d2db
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Wed Mar 16 00:23:47 2016 +0000
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Sat Mar 19 21:42:36 2016 -0700

----------------------------------------------------------------------
 compiler/src/CFCPyMethod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f35c02d9/compiler/src/CFCPyMethod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPyMethod.c b/compiler/src/CFCPyMethod.c
index 3d13665..45b0f86 100644
--- a/compiler/src/CFCPyMethod.c
+++ b/compiler/src/CFCPyMethod.c
@@ -515,7 +515,7 @@ S_gen_meth_invocation(CFCMethod *method, CFCClass *invoker) {
         maybe_assign = "";
     }
     else {
-        maybe_declare = CFCUtil_sprintf("    %s retvalCF;\n",
+        maybe_declare = CFCUtil_sprintf("    %s retvalCF = 0;\n",
                                         CFCType_to_c(return_type));
         maybe_assign = "retvalCF = ";
     }


Mime
View raw message