Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unused variable '__crv' #18

Closed
Macintron opened this issue Aug 13, 2019 · 2 comments
Closed

unused variable '__crv' #18

Macintron opened this issue Aug 13, 2019 · 2 comments

Comments

@Macintron
Copy link

Compiling with Xcode 11 results in this error (7 times):

/obfy/main.cpp:27:5: error: unused variable '__crv' [-Werror,-Wunused-variable]
    OBF_BEGIN
    ^
In file included from /obfy/main.cpp:9:
/obfy/instr.h:816:40: note: expanded from macro 'OBF_BEGIN'
#define OBF_BEGIN try { obf::next_step __crv = obf::next_step::ns_done; std::shared_ptr<obf::base_rvholder> __rvlocal;
                                       ^
/obfy/main.cpp:36:2: error: unused variable '__crv' [-Werror,-Wunused-variable]
        OBF_BEGIN
        ^

cmake automatically created the -Werror when creating the Xcode project with cmake -GXcode ..

Should be easy to fix: insert an 'unused expression' for __crv:
#define OBF_BEGIN try { obf::next_step __crv = obf::next_step::ns_done; std::shared_ptr<obf::base_rvholder> __rvlocal; (void)__crv;
or
#define OBF_END (void)__crv; } catch(std::shared_ptr<...
wherever it makes more sense.

@fritzone
Copy link
Owner

fritzone commented Aug 13, 2019

That actually happens only if you have an empty bodied

OBF_BEGIN
OBF_END

obfuscation block, but regardless I added a (void)__crv; in the OBF_BEGIN to not to have this issue creeping up again.

@Macintron
Copy link
Author

Yep, FOR, WHILE, REPEAT etc. commands use the __crv.
This is (was) a perfectionist issue which is for those with highest warning levels enabled.
Anyway, thanks for fixing this to make this project even more perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants