Giter VIP home page Giter VIP logo

Comments (6)

coelckers avatar coelckers commented on July 18, 2024

Make a pull request. I can't verify these issues because I don't get warnings.

from gzdoom.

edward-san avatar edward-san commented on July 18, 2024

I'm not 100% sure about some of the warnings, so I leave this to cc @alexey-lysiuk who may know it better and can reproduce this.

from gzdoom.

alexey-lysiuk avatar alexey-lysiuk commented on July 18, 2024

I'll try to fix all of them but I need to check changes with MSVC first.

from gzdoom.

alexey-lysiuk avatar alexey-lysiuk commented on July 18, 2024

@edward-san, could you please try #190? It fixes most of warnings except those in codegen.cpp.
I'm not quite sure how this case should be handled in Release configurations, by addition of call to I_Error() probably.

from gzdoom.

edward-san avatar edward-san commented on July 18, 2024

If you're talking about:

/home/edward-san/zdoom/gzdoom/trunk/src/scripting/codegeneration/codegen.cpp:4032:12: warning: 
      variable 'cast' is used uninitialized whenever 'if' condition is false
      [-Wsometimes-uninitialized]
                else if (op2.RegType == REGT_INT) cast = CAST_I2S;
                         ^~~~~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/gzdoom/trunk/src/scripting/codegeneration/codegen.cpp:4034:51: note: 
      uninitialized use occurs here
                build->Emit(OP_CAST, strng2.RegNum, op2.RegNum, cast);
                                                                ^~~~
/home/edward-san/zdoom/gzdoom/trunk/src/scripting/codegeneration/codegen.cpp:4032:8: note: 
      remove the 'if' if its condition is always true
                else if (op2.RegType == REGT_INT) cast = CAST_I2S;
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~               ~
/home/edward-san/zdoom/gzdoom/trunk/src/scripting/codegeneration/codegen.cpp:4016:11: note: 
      initialize the variable 'cast' to silence this warning
                int cast;
                        ^
                         = 0

which still happens, indeed, 'assert' is wrong, although @coelckers made commit e0540c6 which would fix the warning by making the invalid cast converted to CAST_I2F. It could be done the same for the warning above, but is that really okay?

from gzdoom.

coelckers avatar coelckers commented on July 18, 2024

The 'assert' means that this is a case that can only be entered as a programming error. In such a case an assert is enough, this can never happen by passing bogus data to the function.

from gzdoom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.