chore: deprecate C++ scanners

C++ has been a headache to deal with throughout the ecosystem and for
several downstream projects. It is difficult to get working with WASM,
and induces potential issues with compilation on Windows. It has been
proven that writing scanners in C is a much better alternative, and is
the recommended way to write scanners now. C++ support will likely be
removed in 0.21.0
This commit is contained in:
Amaan Qureshi 2024-02-14 15:07:13 -05:00
parent d80d101e34
commit 74812ced1b
2 changed files with 12 additions and 1 deletions

View file

@ -524,7 +524,12 @@ impl Loader {
command.arg("/O2");
}
command.arg(parser_path);
if let Some(scanner_path) = scanner_path.as_ref() {
if scanner_path.extension() != Some("c".as_ref()) {
eprintln!("Warning: Using a C++ scanner is now deprecated. Please migrate your scanner code to C, as C++ support will be removed in the near future.");
}
command.arg(scanner_path);
}
command
@ -560,6 +565,7 @@ impl Loader {
if scanner_path.extension() == Some("c".as_ref()) {
command.arg("-xc").arg("-std=c99").arg(scanner_path);
} else {
eprintln!("Warning: Using a C++ scanner is now deprecated. Please migrate your scanner code to C, as C++ support will be removed in the near future.");
command.arg(scanner_path);
}
}
@ -750,6 +756,7 @@ impl Loader {
.and_then(|ext| ext.to_str())
.map_or(false, |ext| ["cc", "cpp"].contains(&ext))
{
eprintln!("Warning: Using a C++ scanner is now deprecated. Please migrate your scanner code to C, as C++ support will be removed in the near future.");
command.arg("-xc++");
}
command.arg(scanner_filename);