Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
625a9651
Commit
625a9651
authored
Nov 29, 2011
by
Mario Hlawitschka
Browse files
added documentation to the compiler warning about casting function pointers to void* and back
parent
9c365856
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/core/common/WSharedLib.cpp
src/core/common/WSharedLib.cpp
+6
-0
No files found.
src/core/common/WSharedLib.cpp
View file @
625a9651
...
...
@@ -208,6 +208,12 @@ struct WSharedLib::data
*/
func_ptr_type
findFunction
(
const
std
::
string
&
name
)
{
// This cast is supposed to throw a warning because the cast
// of void* to function pointers is not defined or required
// in ISO C. Nevertheless, it works on most current compilers.
//
// man dlsym talks about introducing a new function to circumvent
// this problem.
return
reinterpret_cast
<
func_ptr_type
>
(
findVariable
(
name
)
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment