[PyQt] [PATCH v2 0/6] Fix several warnings when using current GCC

Stefan Brüns stefan.bruens at rwth-aachen.de
Mon Oct 1 02:58:43 BST 2018


GCC 8 throws a warning whenever 0/NULL is used for a null pointer
constant. It also suggests to mark any overridden virtual function
as "override". Third, casting of function pointers of apparently
incompatible type has to be more explicit.

The first patch introduces some helper macros to allow use of
the same identifier in the geneated code regardless if the code
is compiled with a C compiler or as C++ in C++03 or C++11 mode.

The following 4 patches contain the actual fixes for the code
generator.

Compilation has been tested with GCC7 and GCC8. Care has been taken
to generate correct code also for e.g MSVC, although this is
untested.

v2:
- 0001-Add SIP_NULLPTR/SIP_OVERRIDE compatibility macros
  Fix issue with composite module code, compat macros where not included
- 0002-Use SIP_NULLPTR for null pointer constants
  Fix some more occurences of 0/NULL
- 0006-Use SIP_NULLPTR if arg type is a object pointer
  Added, fix one more case where 0 was issued

Stefan Brüns (6):
  Add SIP_NULLPTR/SIP_OVERRIDE compatibility macros
  Use SIP_NULLPTR for null pointer constants
  Use SIP_NULLPTR if return value is a pointer to an object
  Fix GCC cast-function-type warning
  Fix GCC suggest-override warning
  Use SIP_NULLPTR if arg type is a object pointer

 sipgen/gencode.c | 295 ++++++++++++++++++++++++++++-------------------
 1 file changed, 177 insertions(+), 118 deletions(-)

-- 
2.19.0



More information about the PyQt mailing list