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
  • 73,382
  • 53
  • 155
  • 192

3 Answers3

4

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

KJAWolf
  • 2,664
  • 1
  • 15
  • 6
2

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
  • 12,935
  • 11
  • 56
  • 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,760
  • 1
  • 21
  • 34