Displaying 1 result from an estimated 1 matches for "do_something_important".
2012 Mar 14
1
Dealing with printf() &c. in third-party library code
...version of the upstream library is released.
2. Remove all such calls from the code altogether, or comment them
out. The problem here is that doing this safely is hard, because the
call could be part of an "if" statement or similar. For example,
if (test)
printf("Something");
do_something_important;
If the middle line here is removed, then the last line becomes
(erroneously) conditioned on the test. Plus, once again, you are
introducing a lot of small changes to the library itself.
3. Redefine printf to use Rprintf, viz.
#ifdef RNIFTYREG
#include <R.h>
#define printf Rprintf
#endif...