Skip to content

Commit

Permalink
Merge pull request #1345 from kmod/implicit_function_declaration
Browse files Browse the repository at this point in the history
Turn off implicit-function check in release mode
  • Loading branch information
kmod authored Aug 30, 2016
2 parents 92fc9c3 + 9e1ed8a commit 0611d82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
4 changes: 3 additions & 1 deletion from_cpython/Lib/distutils/ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ def _get_cc_args(self, pp_opts, debug, before):
cc_args[:0] = before

if not any ('scipy' in s for s in pp_opts):
cc_args = cc_args + ["-Werror=implicit-function-declaration"]
import sysconfig
if '-DNDEBUG' not in sysconfig.get_config_var('CFLAGS'):
cc_args = cc_args + ["-Werror=implicit-function-declaration"]
return cc_args

def _fix_compile_args(self, output_dir, macros, include_dirs):
Expand Down
15 changes: 4 additions & 11 deletions src/runtime/import.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
void* handle = dlopen(path.c_str(), RTLD_NOW);
if (!handle) {
const char* s = dlerror();
// raiseExcHelper(ImportError, "%s", dlerror());
fprintf(stderr, "%s\n", s);
exit(1);
}
if (!handle)
raiseExcHelper(ImportError, "%s", dlerror());
assert(handle);

std::string initname = "init" + last_name;
void (*init)() = (void (*)())dlsym(handle, initname.c_str());

char* error;
if ((error = dlerror()) != NULL) {
// raiseExcHelper(ImportError, "%s", error);
fprintf(stderr, "%s\n", error);
exit(1);
}
if ((error = dlerror()) != NULL)
raiseExcHelper(ImportError, "%s", error);

assert(init);

Expand Down

0 comments on commit 0611d82

Please sign in to comment.