Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off implicit-function check in release mode #1345

Merged
merged 2 commits into from
Aug 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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