Menu

Skipping variadic functions

2017-08-19
2017-08-19
  • Erik Lundin

    Erik Lundin - 2017-08-19

    Some functions in the Qt API are variadic (i.e. accepting a variable number of arguments), e.g. void critical(const char *msg, ...) in QMessageLogger. The generated wrapper code for this function looks like this:

    void PythonQtWrapper_QMessageLogger::critical(QMessageLogger* theWrappedObject, const char*  msg) const
    {
      ( theWrappedObject->critical(msg));
    }
    

    Compiling this with GCC fails, because the log functions of QMessageLogger expect a format and arguments, and giving them a char pointer yields an error [-Werror=format-security]. Since arguments of variadic functions aren't properly handled anyway, my suggestion is to skip those functions, see patch skip-variadic-functions.diff.

     
  • Erik Lundin

    Erik Lundin - 2017-08-19

    Here is the patch. The file with "unix" in the name has Unix file endings, the other has Windows line endings.

     
  • Florian Link

    Florian Link - 2017-08-20

    Thanks, I will add that. It might take a while because I am busy with other stuff.

     
  • Florian Link

    Florian Link - 2017-08-21

    I merged your patch.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.