Improve linker error message (#2880)

* Improve linker error message

* use file_util/file_is_dir instead

* cleanup unused function

* Some minor updates and merging latest master.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This commit is contained in:
Kiana
2026-01-31 04:55:47 +01:00
committed by GitHub
parent 1b7601fdbb
commit a9d93c93d5
2 changed files with 6 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
### Stdlib changes
### Fixes
- Add error message if directory with output file name already exists
## 0.7.9 Change list

View File

@@ -1051,6 +1051,11 @@ void platform_linker(const char *output_file, const char **files, unsigned file_
vec_add(parts, compiler.build.cc ? compiler.build.cc : default_c_compiler());
}
if (file_is_dir(output_file))
{
error_exit("Failed to link executable '%s', a directory with that name already exists.", output_file);
}
linker_setup(&parts, files, file_count, output_file, linker_type, &compiler.linking);
const char *output = assemble_linker_command(parts, PLATFORM_WINDOWS);
if (compiler.build.print_linking) puts(output);