Add warning for c-style casts to gcc
This commit is contained in:
@@ -152,7 +152,7 @@ if(MSVC)
|
|||||||
# how to workaround or fix the error. So I'm disabling it globally.
|
# how to workaround or fix the error. So I'm disabling it globally.
|
||||||
add_definitions(/wd4503)
|
add_definitions(/wd4503)
|
||||||
else()
|
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)
|
if(APPLE)
|
||||||
add_definitions(-Wno-sign-compare)
|
add_definitions(-Wno-sign-compare)
|
||||||
|
@@ -464,7 +464,7 @@ namespace chaiscript
|
|||||||
memset( &rInfo, 0, sizeof(rInfo) );
|
memset( &rInfo, 0, sizeof(rInfo) );
|
||||||
cast_union u;
|
cast_union u;
|
||||||
u.in_ptr = &ChaiScript::use;
|
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);
|
std::string dllpath(rInfo.dli_fname);
|
||||||
const size_t lastslash = dllpath.rfind('/');
|
const size_t lastslash = dllpath.rfind('/');
|
||||||
if (lastslash != std::string::npos)
|
if (lastslash != std::string::npos)
|
||||||
|
Reference in New Issue
Block a user