Page 1 of 1

Rules of markers usage

Posted: Sat Dec 28, 2013 11:45 am
by samsonite131
I want to protect an entire C/C++ function with a single EP_Marker("reg_crypt_begin1") and EP_Marker("reg_crypt_end1").

However, I read in the docs:
Rules of markers usage
for C and C++ users: the return; keyword can't be placed inside the marker.
I have a problem with this rule. My function is large. It has many return points.

Such as:

Code: Select all

if(!condition1) {
 return 0;
}
else if(!condition2) {
 return 0;
}
etc...
Of course the logic can be much more complex.

Splitting it up would be messy and cumbersome. Why can't markers handle "return"?
Will my program crash if I do a "return 0" inside a marked section?

Re: Rules of markers usage

Posted: Sun Dec 29, 2013 7:19 am
by Enigma
Hi samsonite131,

Yes, there is a set of rules for markers how they could be used.

But, your particular example has to work well anyway. returns in the C++ code do not damage the workability of the protected file.