Commit 0611d82f authored by Kevin Modzelewski's avatar Kevin Modzelewski Committed by GitHub

Merge pull request #1345 from kmod/implicit_function_declaration

Turn off implicit-function check in release mode
parents 92fc9c30 9e1ed8ab
...@@ -373,6 +373,8 @@ class CCompiler: ...@@ -373,6 +373,8 @@ class CCompiler:
cc_args[:0] = before cc_args[:0] = before
if not any ('scipy' in s for s in pp_opts): if not any ('scipy' in s for s in pp_opts):
import sysconfig
if '-DNDEBUG' not in sysconfig.get_config_var('CFLAGS'):
cc_args = cc_args + ["-Werror=implicit-function-declaration"] cc_args = cc_args + ["-Werror=implicit-function-declaration"]
return cc_args return cc_args
......
...@@ -138,23 +138,16 @@ extern "C" Box* import(int level, Box* from_imports, llvm::StringRef module_name ...@@ -138,23 +138,16 @@ extern "C" Box* import(int level, Box* from_imports, llvm::StringRef module_name
BoxedModule* importCExtension(BoxedString* full_name, const std::string& last_name, const std::string& path) { BoxedModule* importCExtension(BoxedString* full_name, const std::string& last_name, const std::string& path) {
void* handle = dlopen(path.c_str(), RTLD_NOW); void* handle = dlopen(path.c_str(), RTLD_NOW);
if (!handle) { if (!handle)
const char* s = dlerror(); raiseExcHelper(ImportError, "%s", dlerror());
// raiseExcHelper(ImportError, "%s", dlerror());
fprintf(stderr, "%s\n", s);
exit(1);
}
assert(handle); assert(handle);
std::string initname = "init" + last_name; std::string initname = "init" + last_name;
void (*init)() = (void (*)())dlsym(handle, initname.c_str()); void (*init)() = (void (*)())dlsym(handle, initname.c_str());
char* error; char* error;
if ((error = dlerror()) != NULL) { if ((error = dlerror()) != NULL)
// raiseExcHelper(ImportError, "%s", error); raiseExcHelper(ImportError, "%s", error);
fprintf(stderr, "%s\n", error);
exit(1);
}
assert(init); assert(init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment