Skip to content
This repository was archived by the owner on Mar 29, 2026. It is now read-only.
Merged
Changes from 1 commit
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
12 changes: 7 additions & 5 deletions src/urh/dev/native/ExtensionHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ def compiler_has_function(compiler, function_name, libraries, library_dirs, incl
try:
try:
file_name = os.path.join(tmp_dir, '{}.c'.format(function_name))
f = open(file_name, 'w')
f.write('int main(void) {\n')
f.write(' %s();\n' % function_name)
f.write('}\n')
f.close()
with open(file_name, 'w') as f:
# declare function in order to prevent Clang 12 error (https://github.com/jopohl/urh/issues/811)
f.write('void %s();\n' % function_name)
f.write('int main(void) {\n')
f.write(' %s();\n' % function_name)
f.write('}\n')

# Redirect stderr to /dev/null to hide any error messages from the compiler.
devnull = open(os.devnull, 'w')
old_stderr = os.dup(sys.stderr.fileno())
Expand Down