Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
d0796500
Commit
d0796500
authored
5 years ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
SCHWED-4612: Get rid of '-Wmaybe-uninitialized' from Vec3
parent
543a4e2c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/geom/src/vec3.hh
+19
-1
19 additions, 1 deletion
modules/geom/src/vec3.hh
with
19 additions
and
1 deletion
modules/geom/src/vec3.hh
+
19
−
1
View file @
d0796500
...
...
@@ -73,6 +73,23 @@ public:
//! explicit initialization with an array of floats
explicit
Vec3
(
const
float
v
[
3
])
:
x
(
v
[
0
]),
y
(
v
[
1
]),
z
(
v
[
2
])
{
}
/* The "=" operator for Vec3 gives the "maybe-uninitialize" warning in
combination with GenericPropValue with GCC when optimisation is turned on.
GenericPropValue is implemented via boost::variant which may confuse GCC
tracking variables through the compilation process. As boost::variant is
able to search for a "=" operator of different type if no direct match is
provided, maybe GCC mixes the Real and Vec3 operators where Real used for
Vec3 would indeed lack the y and z component. According to the GCC manual,
the "maybe-uninitialize" warnings are prone to produce false positives.
There is actually an initiative to get rid of them.
We ignore them for this particular case by saving the current diagnostic
settings (push), disabling the warning in the diagnostics
(ignored "-Wmaybe-uninitialized") and afterwards restoring the old
diagnostics context (pop).
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
//! assignement op
Vec3
&
operator
=
(
const
Vec3
&
v
)
{
...
...
@@ -81,7 +98,8 @@ public:
z
=
v
.
z
;
return
*
this
;
}
#pragma GCC diagnostic pop
//! comparable
bool
operator
==
(
const
Vec3
&
rhs
)
const
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment