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

Suppress warnings for unused variables when SVF_ENABLE_ASSERTIONS is … #1238

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

hjjandy
Copy link
Contributor

@hjjandy hjjandy commented Oct 31, 2023

…not defined.

When SVF_ENABLE_ASSERTIONS is not defined when running cmake, assert in two .h files will be removed, causing unused variable warning. It then leads to compilation errors due to "-Werror -Wunused-variable".

Fixing it by replacing variables in assert with the target expressions. For two functions that cannot be fixed in this way, i.e., CFBasicBlockG.h/add CFBBEdge() and CDG.h/addCDGEDge(), put the two variables in the return statements.

…not defined.

When SVF_ENABLE_ASSERTIONS is not defined when running cmake, assert in two .h files will be removed, causing unused variable warning. It then leads to compilation errors due to "-Werror -Wunused-variable".

Fixing it by replacing variables in assert with the target expressions. For two functions that cannot be fixed in this way, i.e., CFBasicBlockG.h/add CFBBEdge() and CDG.h/addCDGEDge(), put the two variables in the return statements.
@codecov
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Merging #1238 (3e675ae) into master (d414b79) will decrease coverage by 0.01%.
Report is 6 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1238      +/-   ##
==========================================
- Coverage   64.50%   64.49%   -0.01%     
==========================================
  Files         223      223              
  Lines       23667    23669       +2     
==========================================
  Hits        15266    15266              
- Misses       8401     8403       +2     

see 2 files with indirect coverage changes

@yuleisui yuleisui merged commit 1f99ca0 into SVF-tools:master Oct 31, 2023
@yuleisui
Copy link
Collaborator

Thanks for the fix!

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

Successfully merging this pull request may close these issues.

2 participants