Menu

#248 Resolve compile-time warnings

7
closed
API (105)
1
2024-09-20
2024-06-19
No

When warnings level is set to high, both C++ Builder and Visual C++ compile OWLNext with a lot of warnings.

We should clean as much as possible of these, as they can have adverse effect on compilation speed in user code that includes a lot of OWLNext headers.

Also reducing the number of warnings in OWLNext headers will make it easier to catch issues pointed by warnings in user code.

See discussion https://sourceforge.net/p/owlnext/discussion/97175/thread/e62de7e00c/

Related

Discussion: Warnings slowing down compilation
Discussion: Warnings slowing down compilation
Discussion: Preparing updates for OWLNext 7.0, 6.44 and 6.36
Discussion: Preparing updates for OWLNext 7.0, 6.44 and 6.36
Feature Requests: #248
Wiki: OWLNext_Stable_Releases

Discussion

1 2 > >> (Page 1 of 2)
  • Ognyan Chernokozhev

    Enabling warnings pointed to a small bug in TMenuGuard::RelinquishOwnership returning wrong value.

    Fixed in trunk: [r6994].
    Merged in 7.0 branch: [r7001].

     

    Related

    Commit: [r6994]
    Commit: [r7001]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Eliminated a number of Level 4 warnings reported by Visual C++.

    trunk: [r6995].
    7.0: [r7002], fixed some regressions in [r7003].

     

    Related

    Commit: [r6995]
    Commit: [r7002]
    Commit: [r7003]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Replaced usages of NULL with nullptr.

    trunk: [r6996].
    7.0: [r7004].

     

    Related

    Commit: [r6996]
    Commit: [r7004]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Eliminated warnings reported by C++Builder about using 0 instead of nullptr.

    trunk: [r6997].
    7.0: [r7005].

     

    Related

    Commit: [r6997]
    Commit: [r7005]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Eliminated many "0 as nullptr" warnings.

    trunk: [r7019].
    7.0: [r7020].

     

    Related

    Commit: [r7019]
    Commit: [r7020]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Fixed an 'unused parameter' warning in dc.h.

    trunk: [r7021].
    Note: New code that is not present in 7.0.

     

    Related

    Commit: [r7021]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Fixed an 'unused parameter' warning in dispatch.h.

    trunk: [r7022].
    7.0: [r7023].

     

    Related

    Commit: [r7022]
    Commit: [r7023]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Removed the __OWL_OWLDEFS_H macro.
    This macro according to a comment was only for VbxGen compatibility, and this is a tool no longer used.

    trunk: [r7024].
    7.0: [r7025].

     

    Related

    Commit: [r7024]
    Commit: [r7025]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Disabled "extension" warnings in number.h.

    trunk: [r7027].
    7.0: [r7033].

     

    Related

    Commit: [r7027]
    Commit: [r7033]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Removed obsolete unused macros.

    _DOCVIEWCLASS and _DOCVIEWENTRYare no longer used.

    _DOCVIEWCLASS was used in OWL5 for TOleLinkView, but that class has been moved to OCFNext.

    _DOCVIEWENTRY was used for TDocTemplateT only in 16-bit builds which are no longer supported.

    trunk: [r7028].
    7.0: [r7034].

     

    Related

    Commit: [r7028]
    Commit: [r7034]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Removed unused obsolete macro _RTTI.

    It may have been needed for old non-standard-compliant compilers like BC++ 5.02.

    trunk: [r7029].

    Note: Used in some more places in 7.0, will require separate code change to remove.

     

    Related

    Commit: [r7029]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Removed extra semicolons.

    trunk: [r7030].

    Note: Some of the places are in new code in trunk, may require separate code change to resolve in 7.0.

     

    Related

    Commit: [r7030]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Eliminated 'macro not defined, evaluates to 0' warnings.

    trunk: [r7031].
    7.0: [r7035].

     

    Related

    Commit: [r7031]
    Commit: [r7035]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Added override to destructors.

    trunk: [r7032].
    7.0: [r7036].

     

    Related

    Commit: [r7032]
    Commit: [r7036]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Removed obsolete check for checks.h.

    Another legacy of BC++ 5.02 where there was a separate non-OWL header checks.h.

    trunk: [r7040].
    7.0: [r7044].

     

    Related

    Commit: [r7040]
    Commit: [r7044]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Renamed the sentry macro for picker.h.

    trunk: [r7041].
    7.0: [r7045].

     

    Related

    Commit: [r7041]
    Commit: [r7045]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Suppressed "zero is a null pointer constant" warnings in window.h and dispatch.h.

    The warnings were given for the usage of HWND_DESKTOP and HANDLE_WM_NCACTIVATE, which are defined in SDK headers and cannot be changed.

    trunk: [r7042].
    7.0: [r7046].

     

    Related

    Commit: [r7042]
    Commit: [r7046]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    Fixed some "zero is a null pointer constant" warnings.

    trunk: [r7043].
    7.0: [r7047].

     

    Related

    Commit: [r7043]
    Commit: [r7047]


    Last edit: Ognyan Chernokozhev 2024-06-19
  • Ognyan Chernokozhev

    A number of member methods of TSysLink are defined like this:

      auto GetIdealHeight() -> int const;
    

    This looks like a mistake - shouldn't it be

      auto GetIdealHeight() const -> int;
    

    Fixed in trunk in [r7053].

    Note: the change may be binary incompatible, so for the moment will not be merged into the 7.0 branch.

     

    Related

    Commit: [r7053]

  • Vidar Hasfjord

    Vidar Hasfjord - 2024-06-19

    @jogybl wrote:

    This looks like a mistake [in TSysLink methods]

    Yes, this is a bug of mine. Cool that your work on eliminating warnings identified it. I should have turned on all warnings when writing that class.

    Good work!

     
    👍
    1
  • Ognyan Chernokozhev

    Some methods in TFile and TTextFile are defined like this:

    virtual void _OWLENTRY writeUint8( const uint8 )
    virtual void _OWLENTRY writeUint16( const uint16 );
    

    The const modifier of the parameter makes no sense - we should remove it.

    Since the method is virtual, there is a small chance it may break user code if it is deriving from either class and overriding these methods.

    The change should be made only in trunk, as it can also break binary compatibility of the dlls.

     
    👍
    1
  • Ognyan Chernokozhev

    Eliminated some old-style C cast warnings.

    trunk: [r7054].
    7.0: [r7055].

     

    Related

    Commit: [r7054]
    Commit: [r7055]

1 2 > >> (Page 1 of 2)

Anonymous
Anonymous

Add attachments
Cancel