[pypy-commit] cffi default: Document the new warning

arigo pypy.commits at gmail.com
Thu Sep 15 02:53:40 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r2770:5fc2d2cf2f5d
Date: 2016-09-15 08:53 +0200
http://bitbucket.org/cffi/cffi/changeset/5fc2d2cf2f5d/

Log:	Document the new warning

diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -3679,6 +3679,8 @@
 
 def test_char_pointer_conversion():
     import warnings
+    assert __version__.startswith(("1.8", "1.9")), (
+        "consider turning the warning into an error")
     BCharP = new_pointer_type(new_primitive_type("char"))
     BIntP = new_pointer_type(new_primitive_type("int"))
     BVoidP = new_pointer_type(new_void_type())
diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst
--- a/doc/source/whatsnew.rst
+++ b/doc/source/whatsnew.rst
@@ -3,6 +3,19 @@
 ======================
 
 
+v1.8.3
+======
+
+* When passing a ``void *`` argument to a function with a different
+  pointer type, or vice-versa, the cast occurs automatically, like in C.
+  The same occurs for initialization with ``ffi.new()`` and a few other
+  places.  However, I thought that ``char *`` had the same
+  property---but I was mistaken.  In C you get the usual warning if you
+  try to give a ``char *`` to a ``char **`` argument, for example.
+  Sorry about the confusion.  This has been fixed in CFFI by giving for
+  now a warning, too.  It will turn into an error in a future version.
+
+
 v1.8.2
 ======
 


More information about the pypy-commit mailing list