Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added an exit() to JSON_FAIL_MESSAGE to fix "no return" errors.

git-svn-id: https://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk@248 1f120ed1-78a5-a849-adca-83f0a9e25bb6
  • Loading branch information...
commit dc8e373c1081a181ebb22301a2b0048da67036cf 1 parent e7d82ca
aaronjacobs authored rjeczalik committed

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +4 4 jsoncpp/include/json/assertions.h
8 jsoncpp/include/json/assertions.h
@@ -19,10 +19,10 @@
19 19 #define JSON_ASSERT( condition ) assert( condition );
20 20
21 21 // The call to assert() will show the failure message in debug builds. In
22   -// release bugs we write to invalid memory in order to crash hard instead of
23   -// calling exit(), so that a debugger or crash reporter gets the chance to take
24   -// over.
25   -#define JSON_FAIL_MESSAGE( message ) { assert(false && message); strcpy(reinterpret_cast<char*>(666), message); }
  22 +// release bugs we write to invalid memory in order to crash hard, so that a
  23 +// debugger or crash reporter gets the chance to take over. We still call exit()
  24 +// afterward in order to tell the compiler that this macro doesn't return.
  25 +#define JSON_FAIL_MESSAGE( message ) { assert(false && message); strcpy(reinterpret_cast<char*>(666), message); exit(123); }
26 26
27 27 #endif
28 28

0 comments on commit dc8e373

Please sign in to comment.
Something went wrong with that request. Please try again.