Add warning for c-style casts to gcc

This commit is contained in:
Jason Turner
2015-01-07 13:56:48 -07:00
parent 52d03a66b1
commit d91294b989
2 changed files with 2 additions and 2 deletions

View File

@@ -152,7 +152,7 @@ if(MSVC)
# how to workaround or fix the error. So I'm disabling it globally.
add_definitions(/wd4503)
else()
add_definitions(-Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic ${CPP11_FLAG})
add_definitions(-Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -pedantic ${CPP11_FLAG})
if(APPLE)
add_definitions(-Wno-sign-compare)

View File

@@ -464,7 +464,7 @@ namespace chaiscript
memset( &rInfo, 0, sizeof(rInfo) );
cast_union u;
u.in_ptr = &ChaiScript::use;
if ( dladdr((void*)(u.out_ptr), &rInfo) && rInfo.dli_fname ) {
if ( dladdr(static_cast<void*>(u.out_ptr), &rInfo) && rInfo.dli_fname ) {
std::string dllpath(rInfo.dli_fname);
const size_t lastslash = dllpath.rfind('/');
if (lastslash != std::string::npos)