Author Topic: Crashing After Ending  (Read 32111 times)

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Crashing After Ending
« Reply #15 on: September 19, 2009, 05:07:51 PM »
I wonder why Dev-C++ never complained.

GCC is probably doing things slightly different way. I also noticed that VC++ was better at catching errors, but it also depends on warning settings. In VC++ I think W3 (default) is the best option, because W4 (highest) is warning about all type conversions.. still I think it's good to fix those unsigned/signed warnings in important places like for loops.

corremn

  • Rogueliker
  • ***
  • Posts: 700
  • Karma: +0/-0
  • SewerJack Extraordinaire
    • View Profile
    • Demise RogueLike Games
Re: Crashing After Ending
« Reply #16 on: September 20, 2009, 10:13:37 AM »
That did it. Thanks, Krice. I wonder why Dev-C++ never complained. There's some other stuff I need to clean up, but it's mostly just signed/unsigned mismatches in my for() loops, which won't take long to correct.

EDIT: All right, it stopped complaining about those. Whatever.

Warnings will only appear when recompiling.  They are not a problem but its best to fix them so you dont miss an important warning amongst other warnings.  Best practice is to get rid of all warnings.
corremn's Roguelikes. To admit defeat is to blaspheme against the Emperor.  Warhammer 40000 the Roguelike

purestrain

  • Rogueliker
  • ***
  • Posts: 172
  • Karma: +0/-0
    • View Profile
Re: Crashing After Ending
« Reply #17 on: September 20, 2009, 06:34:15 PM »
Warnings are so useless... either something is an error or its not - there is no maybe.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Crashing After Ending
« Reply #18 on: September 20, 2009, 06:55:57 PM »
Warnings are so useless... either something is an error or its not - there is no maybe.

Warnings are often related to poorly written code that may trigger a bug in certain situation. I think those are much worse than straight errors.

corremn

  • Rogueliker
  • ***
  • Posts: 700
  • Karma: +0/-0
  • SewerJack Extraordinaire
    • View Profile
    • Demise RogueLike Games
Re: Crashing After Ending
« Reply #19 on: September 21, 2009, 12:21:16 AM »
Krice is right. 

Sometimes you write perfectly logical code, but the same code used another way will produce the incorrect behaviour.  The compiler doesn't know what you intend so it warnings to tell you that this code may have bugs.
A simple example is converting a float to an int.  You lose data doing so, but most of the time thats what you want. So the compiler just reminds you to put explicit type conversion in your code, now the compiler knows what you intended.
corremn's Roguelikes. To admit defeat is to blaspheme against the Emperor.  Warhammer 40000 the Roguelike

purestrain

  • Rogueliker
  • ***
  • Posts: 172
  • Karma: +0/-0
    • View Profile
Re: Crashing After Ending
« Reply #20 on: September 21, 2009, 06:20:32 AM »
Thats what i say; warnings are useless; either its an error, or its not. If the compiler knows that it could probably lead to a bug, its an error.... If something happens implicitly converted to a less exact format, its a error.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Crashing After Ending
« Reply #21 on: September 21, 2009, 12:55:37 PM »
If the compiler knows that it could probably lead to a bug, its an error....

Warning and error are two different things for the compiler, no matter how you might understand it.