UnAngband - inconsistent variable declaration

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Azerath
    Rookie
    • Jun 2011
    • 21

    UnAngband - inconsistent variable declaration

    Hi,

    I've been trying to compile&debug directly from VS2010. I've been able successfully compile and run it, but it required to make some small changes to source code - all of them related to non C compliant variable declaration.

    cmd5.c (l:420) has declared 3 variables after if statement. moving them to begining of scope solves the problem.

    store.c (l:2425) contains int old_number variable declared inline, moving it to begining of function together with other variables solves the problem.

    The source code is taken from download unangband-064a-src.zip

    Regards
  • andrewdoull
    Unangband maintainer
    • Apr 2007
    • 872

    #2
    Thanks - will fix.

    I'm a little surprised gcc wasn't picking this up and at least generating warnings.
    The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
    In UnAngband, the level dives you.
    ASCII Dreams: http://roguelikedeveloper.blogspot.com
    Unangband: http://unangband.blogspot.com

    Comment

    • Azerath
      Rookie
      • Jun 2011
      • 21

      #3
      Maybe "pedantic" switch to compiler would help? Without this declaration cane be anywhere not only at begining of block.

      Comment

      • zaimoni
        Knight
        • Apr 2007
        • 590

        #4
        Originally posted by andrewdoull
        Thanks - will fix.

        I'm a little surprised gcc wasn't picking this up and at least generating warnings.
        The issues are legal C99, but illegal C90. MSVC is a C90 compiler, and makes no pretence of comprehensive C99 support.
        Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
        Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
        Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011

        Comment

        • Azerath
          Rookie
          • Jun 2011
          • 21

          #5
          Pssst! Pssst! hold your horse boy! I'm not an enemy! Next time you would fight with MS evil! :-)

          If you want to prevent from Windows corruption in roguelikes world, just create Angband version that prevents in license running from windows systems ;-)

          Comment

          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎