Menu

#12 reduce number of compilation warnings

1.2
open
nobody
None
Low
All
2019-02-11
2019-02-11
No

1) Replace NULL with Q_NULLPTR

warning: zero as null pointer constant
expanded from macro 'NULL'

2) Remove unused variables or comment them.

warning: unused variable 'noButton'

3) Implicit conversion between signed and unsigned integers.

warning: implicit conversion changes signedness: 'unsigned int' to 'int'
warning: implicit conversion changes signedness: 'int' to 'unsigned int'

4) Add virtual destructor

warning: delete called on 'VideoEncoder' that is abstract but has non-virtual destructor

5) Add attribute NO_RETURN to non-return function

warning: function 'closeApplication' could be declared with attribute 'noreturn'

These warnings are appeared when the applications compiles with Qt 5.11.3, MSVC2017 64bit (Microsoft Visual C++ Compiler 15.0), cmake version 3.13.2

Discussion

  • Dmitry Valento

    Dmitry Valento - 2019-02-11
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -8,3 +8,17 @@
     warning: unused variable 'noButton'
     ~~~
    
     3. Implicit conversion between signed and unsigned integers.
    +~~~
    +warning: implicit conversion changes signedness: 'unsigned int' to 'int'
    +warning: implicit conversion changes signedness: 'int' to 'unsigned int'
    +~~~
    +4. Add virtual destructor
    +~~~
    +warning: delete called on 'VideoEncoder' that is abstract but has non-virtual destructor
    +~~~
    +5. Add attribute NO_RETURN to non-return function
    +~~~
    +warning: function 'closeApplication' could be declared with attribute 'noreturn'
    +~~~
    +
    +These warnings are appeared when the applications compiles with Qt 5.11.3, MSVC2017 64bit (Microsoft Visual C++ Compiler 15.0), cmake version 3.13.2
    
     
  • Dmitry Valento

    Dmitry Valento - 2019-02-11
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,22 +1,22 @@
    -1. Replace NULL with Q_NULLPTR
    +1) Replace NULL with Q_NULLPTR
     ~~~
     warning: zero as null pointer constant
     expanded from macro 'NULL'
     ~~~
    -2. Remove unused variables or comment them.
    +2) Remove unused variables or comment them.
     ~~~
     warning: unused variable 'noButton'
     ~~~
    -3. Implicit conversion between signed and unsigned integers.
    +3) Implicit conversion between signed and unsigned integers.
     ~~~
     warning: implicit conversion changes signedness: 'unsigned int' to 'int'
     warning: implicit conversion changes signedness: 'int' to 'unsigned int'
     ~~~
    -4. Add virtual destructor
    +4) Add virtual destructor
     ~~~
     warning: delete called on 'VideoEncoder' that is abstract but has non-virtual destructor
     ~~~
    -5. Add attribute NO_RETURN to non-return function
    +5) Add attribute NO_RETURN to non-return function
     ~~~
     warning: function 'closeApplication' could be declared with attribute 'noreturn'
     ~~~
    
     

Log in to post a comment.

MongoDB Logo MongoDB