Menu

v0.94: huge pile of compiler warnings in VSCE2019

2020-11-07
2020-11-09
  • Georg Stroehlein

    Hi Lorenzo and everybody else,
    when loading the VS project file, which is thanksfully delivered within the v0.94 archive, into VSCE2019, I was asked whether I wanted to update the toolchain from v120 to v142. I answered yes. After that, I was able to build all programs as x64-release, but the amount of warnings thrown by VSCE2019 frightens me, because I cannot judge whether the computed results of the programs are compromised or not. I have attached a text file showing the entire output of VSCE2019 during compilation.
    Can somebody please comment on (some of) these warnings??
    All the best
    Schorsch

     
  • Lorenzo

    Lorenzo - 2020-11-09

    Only Chris can answer for sure. While waiting for his feedback I can give some general considerations. I've never used Visual Studio, but it may just be that you compiled with 'debug' compiler flags on, which triggered a lot of warnings.

    In your file there are 70 lines labelled as 'messages' (which I think we can ignore), and 397 'warnings'.
    Of the warnings, about half (196) are of this type:
    warning C4244: 'return': conversion from 'PractRand::Uint64' to 'PractRand::Uint32', possible loss of data

    which probably a totally okay and intended way to extract the lowest 32 bits from a 64 bit variable.
    The next most common warning (56 occurrences) is of the type:
    warning C4010: single-line comment contains line-continuation character

    Something to do with comment lines, ie nothing critical at all.
    Then, 47 occurrences of:
    warning C4267: 'return': conversion from 'size_t' to 'long', possible loss of data

    which is another variable type conversion (probably intended). Next (21 occurrences):
    warning C4018: '>=': signed/unsigned mismatch 21

    that, is, we are comparing for greater-or-equal-than a signed with an unsigned variable. In 'normal' life this doesn't make much sense, but for PractRand it is probably ok and intended.
    Then (15 occurrences):
    warning C4101: 'uncertainty': unreferenced local variable

    A variable defined but never used. Maybe it should be cleaned up, but not necessarily. It won't harm anyway.

    There 45 more warnings, of 7 different types. Some more conversion warnings, constant expressions used in a 'if' block and other types. Nothing that looks dangerous (although it's impossible to tell for sure without looking at the code). So overall I wouldn't worry too much.

     

Log in to post a comment.