Menu

#672 Compiler warnings with clang 10

Linux only
closed-out-of-date
None
5
2022-12-20
2021-01-15
No

Tested code: SVN revision 1568 with patch "c" from ticket #671
Tested compiler: clang 10.0.1 (on NetBSD/amd64)

List of warnings is attached.

1 Attachments

Discussion

  • Wesley Johnson

    Wesley Johnson - 2021-01-23

    The candidate patch for the clang complaints.
    Thank you for checking. Some of these really needed fixing.
    Makes me wonder how well Gcc is checking some things.

     
  • Michael Bäuerle

    There is still one warning with clang 10:

    r_things.c:489:29: warning: result of comparison of constant -1 with expression of type 'uint16_t' (aka 'unsigned short') is always true [-Wtautological-constant-out-of-range-compare]
        if( (rtp->spritelump_id != -1) && devparm )
             ~~~~~~~~~~~~~~~~~~ ^  ~~
    1 warning generated.
    

    PS: This patch format is inconvenient. Neither BSD nor GNU patch detects the filenames and I have to enter them manually. Please create unified diffs.

     
  • Wesley Johnson

    Wesley Johnson - 2021-01-26

    Sorry, I never use that patch format so my fingerrs must have slpped.
    New version. Fixed the -1.
    I hope there is a net gain in the number of lurking bugs fixed, vrs the number of lurking bugs introduced by the patch.

     
    • Michael Bäuerle

      Looks good now. No more warnings.

       
  • Michael Bäuerle

    Tested again with SVN revision 1574 => No warnings.

     
  • Michael Bäuerle

    Tested again with SVN revision 1620 and clang 13.0.0:

    In file included from r_draw.c:751:
    ./r_draw8.c:312:22: warning: variable 'frac' set but not used [-Wunused-but-set-variable]
        register fixed_t frac;
                         ^
    In file included from r_draw.c:759:
    ./r_draw16.c:146:25: warning: variable 'frac' set but not used [-Wunused-but-set-variable]
        fixed_t             frac;
                            ^
     2 warnings generated.
    
    r_segs.c:1747:14: warning: variable 'topheight' set but not used [-Wunused-but-set-variable]
        fixed_t  topheight, heightstep, bot_patch;
                 ^
    1 warning generated.
    
    qmus2mid.c:404:14: warning: variable 'TotalTime' set but not used [-Wunused-but-set-variable]
        uint32_t TotalTime=0;
                 ^
    1 warning generated.
    
     
  • Wesley Johnson

    Wesley Johnson - 2022-04-04
    • assigned_to: Wesley Johnson
     
  • Wesley Johnson

    Wesley Johnson - 2022-12-20
    • status: open --> closed-out-of-date
     

Log in to post a comment.