/
f19569c.bug
95 lines (91 loc) · 3.16 KB
/
f19569c.bug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
%YAML 1.1
---
id: f19569c
title: "One definition rule (ODR) violation in C++"
description: >
Since 2003 C++ requires at most a single definition (don't confuse with
declaration) for an identifier. An exception is made for inline functions,
as the rule is exploited to resolve overloading by names at at linking time
(so inlined functions are not affected).
Several tf2 modules had non-inline functions defined in a header file, which
lead to multiple definitions (in every file that included the header). This
has been rectified by qualifying the functions as inline.
In general ODR violations can be symptoms of more serious dependency issues,
name violation issues, name-space problems, or cut & paste programming. In
this particular case, it seems that the violation was not harmful, and the
"inline" modifier was mostly added to remove a compiler warning.
The pull request has addressed also other unrelated issues, through several
commits. The commit referenced below in the description is the one that fixes
the ODR issue.
The second link (under the 'links' key below) points to an interesting post
from the gcc developer implementing the ODR checker. It lists problems
and dangers, rationalizing the rule and the enforcement.
classification: One definition rule violation (no CWE)
keywords: ["build", "types and names"]
system: core component
severity: warning
links:
- https://en.wikipedia.org/wiki/One_Definition_Rule
- https://hubicka.blogspot.com/2014/09/devirtualization-in-c-part-6-enforcing.html
bug:
phase: build
specificity: general issue
architectural-location: platform code
application: N/A
task: N/A
subsystem: generic task component
package:
- ros/geometry2/tf2_bullet
- ros/geometry2/tf2_geometry_msgs
- ros/geometry2/tf2_kdl
- ros/geometry2/tf2_sensor_msgs
languages:
- C++
detected-by: null
reported-by: null
issue: null
time-reported: null
reproducibility: always
trace: null
reproduction: null
fix:
pull-request: https://github.com/ros/geometry2/pull/76
fix-in:
- tf2_bullet/include/tf2_bullet/tf2_bullet.h
- tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.h
- tf2_kdl/include/tf2_kdl/tf2_kdl.h
- tf2_sensor_msgs/include/tf2_sensor_msgs/tf2_sensor_msgs.h
languages:
- C++
time: 2015-03-03 (10:03 GMT+1)
commits:
- repo: https://github.com/ros/geometry2
hash: f19569cf095cdb92ab012a2ffa03c1074bad2c4a
stats:
total:
insertions: 41
deletions: 4
lines: 45
files: 4
files:
tf2_bullet/include/tf2_bullet/tf2_bullet.h:
insertions: 5
deletions: 1
lines: 6
tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.h:
insertions: 18
deletions: 2
lines: 20
tf2_kdl/include/tf2_kdl/tf2_kdl.h:
insertions: 13
deletions: 1
lines: 14
tf2_sensor_msgs/include/tf2_sensor_msgs/tf2_sensor_msgs.h:
insertions: 5
deletions: 0
lines: 5
fault-codes:
- PROGRAMMING:COMPILER-ERROR
failure-codes:
- SOFTWARE:BUILD
- SYSTEM:NONE