7

I am refactoring some MFC code that is littered with ASSERT statements, and in preparation for a future Linux port I want to replace them with the standard assert. Are there any significant differences between the two implementations that people know of that could bite me on the backside?

Similarly, I have also come across some code that uses ATLASSERT which I would also like to replace.

Rob
  • 76,700
  • 56
  • 158
  • 197

3 Answers3

5

No. The MFC version just includes an easy to debug break point.

KJAWolf
  • 2,722
  • 1
  • 15
  • 6
3

Replace them with your own assertion macro. That's how you get the most benefit out of it (logging, stack trace, etc.)

Community
  • 1
  • 1
Carl Seleborg
  • 13,125
  • 11
  • 58
  • 70
1

I would recommend either using your own macro, or #define's for the linux compilation. There's no compelling reason to give up any extra helpfulness on the Windows side (eg: built-in breakpoint), and no compelling reason to change a lot of code when some simple compatibility #define's will suffice.

Nick
  • 6,808
  • 1
  • 22
  • 34