-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CGAL: Deal with CGAL_assertion(false) #8496
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, so far, except for one case.
Actually, I am not so sure with should replace CGAL_assertion(false)
with CGAL_unreachable()
everywhere. For users activating the CGAL assertions even in production, the code will behave differently.
Triangulation_on_sphere_2/include/CGAL/Triangulation_on_sphere_2.h
Outdated
Show resolved
Hide resolved
Oh, I always assumed that |
I am not sure it was intended. The commit that introduced that behavior is 604d2fd. Actually, I think it was intentional. The goal was to convince the compiler that the branch was dead, to remove warnings. That means
|
Does that mean we should use |
Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h
Outdated
Show resolved
Hide resolved
Concerning |
Note The name is |
8bf9639
to
071a9c2
Compare
@sloriot this is no longer WIP. |
Successfully tested in CGAL-6.0.1-Ic-345 |
@sloriot what has to be approved? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I don't like with CGAL_unreachable()
replacement is that if there is a bug in CGAL code and that we reach a place marked as unreachable no assertion will be thrown. Maybe we should modify the macro to also raise CGAL_assertion(false)
.
@@ -780,7 +780,7 @@ class Vertex_conflict_C2 | |||
|
|||
// philaris: execution should never reach here | |||
// philaris: code added to avoid warnings on some compilers | |||
CGAL_assertion( false ); | |||
CGAL_assertion(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no change in this file?
Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h
Show resolved
Hide resolved
The whole point is to tell the compiler that it can go ahead and optimize things. For example for the three orientation switch. |
I know, what I'm saying is that the doc of |
Summary of Changes
Replace or remove some
CGAL_assertion(false)
where it is sure that the code is unreachable, regardless the input. This is typically aswitch
for three enum values with 3case
statements that all return and where we have verified.Release Management