#1635 qt build: only use -W flags and -ldl on linux


These changes were needed to build on freebsd 9.2

1 Attachments


  • Neil Hodgson

    Neil Hodgson - 2014-08-06

    With this change there are some new warnings on Linux as the -Wno-unused-parameter doesn't seem to be used in cases where it was before. The command line and messages are

    g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DSCINTILLA_QT=1 -DMAKING_LIBRARY=1 -DSCI_LEXER=1 -D_CRT_SECURE_NO_DEPRECATE=1 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I../ScintillaEdit -I../ScintillaEditBase -I../../include -I../../lexlib -I../../src -I/usr/include/python2.7 -I/usr/include/shiboken -I/usr/include/PySide -I/usr/include/PySide/QtCore -I/usr/include/PySide/QtGui -I. -o scintillaeditpy_module_wrapper.o ScintillaEditPy/scintillaeditpy_module_wrapper.cpp
    In file included from /usr/include/shiboken/shiboken.h:30:0,
                     from ScintillaEditPy/scintillaeditpy_module_wrapper.cpp:3:
    /usr/include/shiboken/conversions.h:144:24: warning: unused parameter 'pyObj' [-Wunused-parameter]
         static inline bool checkType(PyObject* pyObj) { return false; }
    /usr/include/shiboken/conversions.h:145:24: warning: unused parameter 'pyobj' [-Wunused-parameter]
         static inline bool isConvertible(PyObject* pyobj) { return true; }
    /usr/include/shiboken/conversions.h:294:17: warning: unused parameter 'value' [-Wunused-parameter]
         static bool check(const PY_LONG_LONG& value)
    /usr/include/shiboken/conversions.h:303:17: warning: unused parameter 'value' [-Wunused-parameter]
         static bool check(const double& value)

    This may not be really important as it seems to build and run but I like to maintain a clean compile with no warnings when possible. It could indicate that the unix:linux branch isn't executed which may cause other problems on some versions of Linux or Qt since -ldl isn't added to LIBS.

  • Neil Hodgson

    Neil Hodgson - 2014-08-06
    • labels: --> scintilla, qt
    • status: open --> open-fixed
    • assigned_to: Neil Hodgson
  • Neil Hodgson

    Neil Hodgson - 2014-08-06

    The correct scope is unix:linux-* since there are linux-g++ and linux-icc scopes. That makes the warnings go away.
    Committed as [ba0407] and [5b92f3].



    Commit: [5b92f3]
    Commit: [ba0407]

  • Colomban Wendling

    FWIW I don't like such a "fix", as it actually has nothing to do with the platform, only about the GCC version (I don't know which version introduced the flag, but I can't imagine such a warning to be platform-specific -- and FreeBSD 9 seems to have GCC 4.2).

    A correct fix would rather be to check whether the compiler supports the flag or not, although that's indeed trickier. Other solutions include not to have those flags in the build files directly, or have an easy way to override/disable them (I don't know if they are already, just guessing).

    • Neil Hodgson

      Neil Hodgson - 2014-08-06

      This is a qmake project file so its possible to run the compiler and ask for its version. However, qmake is complex.

      I don't know what conditions "-ldl" is needed since it didn't fail the build on Mint 17. I expect its become the default on some level.

      The file showing warnings is generated by PySide so it can't just have #pragmas added.

  • John Ehresman

    John Ehresman - 2014-08-06

    I agree that it would be better to do this based on compiler version or some sort of configure like check, but I don't know how to do that in qmake.

    • Neil Hodgson

      Neil Hodgson - 2014-08-06

      The start of a compiler version check could be http://stackoverflow.com/questions/801279/finding-compiler-vendor-version-using-qmake

      Since the warnings occur in /usr/include/shiboken/conversions.h which is a PySide header, a patch could be pushed to PySide to avoid these warnings by not providing a parameter name for each of these inline functions or commenting the parameter. The conversions.h file appears to be human-edited instead of generated.

      For example,

      static inline bool checkType(PyObject* pyObj) { return false; }

      would become

      static inline bool checkType(PyObject*) { return false; }


      static inline bool checkType(PyObject* /* pyObj */) { return false; }

      I don't know of a better way to handle the dl library.

  • Neil Hodgson

    Neil Hodgson - 2014-08-14
    • status: open-fixed --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks