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:
parent
d80d101e34
commit
74812ced1b
2 changed files with 12 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue