On 11/02/14 18:42, Bram Moolenaar wrote:

Tony Mechelynck wrote:

On 11/02/14 16:00, Bram Moolenaar wrote:

Patch 7.4.174
Problem:    Compiler warnings for Python interface. (Tony Mechelynck)
Solution:   Add type casts, initialize variable.
Files:      src/if_py_both.h

In incremental build for patches 173-175 I get the following:

- In tiny build but not in huge build:

I know how to fix the unused variable problem.

I do not get the other error myself.  Can you please check if this works
around it:

    else if (flags & DICT_FLAG_RETURN_BOOL)
     {
        ret = Py_True;
        Py_INCREF(ret);
        return ret;
     }



This makes the warning disappear, yes. I'm attaching the git-style patch as produced by Mercurial with the mq extension enabled.


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
84. Books in your bookcase bear the names Bongo, WinSock and Inside OLE

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
# HG changeset patch
# Parent b123e18ef3c1afd3639856ef45ef00f2ba0caa0c
# User Bram Moolenaar <[email protected]>
strict-aliasing warning @ if_py_both.h:1620

diff --git a/src/if_py_both.h b/src/if_py_both.h
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -1612,18 +1612,19 @@ DictionaryLength(DictionaryObject *self)
 	else
 	{
 	    PyErr_SetObject(PyExc_KeyError, keyObject);
 	    return NULL;
 	}
     }
     else if (flags & DICT_FLAG_RETURN_BOOL)
     {
-	Py_INCREF(Py_True);
-	return Py_True;
+	ret = Py_True;
+	Py_INCREF(ret);
+	return ret;
     }
 
     di = dict_lookup(hi);
 
     if (!(ret = ConvertToPyObject(&di->di_tv)))
 	return NULL;
 
     if (flags & DICT_FLAG_POP)

Raspunde prin e-mail lui