C2Rust fails when translating a C program that uses the compiler builtin __builtin_nans. The translation stops during main and reports that this builtin is unimplemented.
This appears to be an unsupported builtin handling issue for signaling NaN generation.
To Reproduce
#include <stdio.h>
int main(void) {
double x = __builtin_nans("");
printf("%f\n", x);
return 0;
}
Run C2Rust translation on the file:
Observed Behavior
C2Rust fails during translation:
Transpiling test.c
error: Failed to translate main: Unimplemented builtin __builtin_nans
--> test.c:4:16
Expected Behavior
C2Rust should either translate __builtin_nans to an equivalent Rust representation, or emit a more graceful unsupported-feature diagnostic without failing the whole function translation unexpectedly.
Environment
- c2rust version: v0.21.0
- platform: Ubuntu 24.04
- Rust: nightly-2022-08-08
- Clang version: 17.0.6
C2Rust fails when translating a C program that uses the compiler builtin
__builtin_nans. The translation stops duringmainand reports that this builtin is unimplemented.This appears to be an unsupported builtin handling issue for signaling NaN generation.
To Reproduce
Run C2Rust translation on the file:
Observed Behavior
C2Rust fails during translation:
Expected Behavior
C2Rust should either translate
__builtin_nansto an equivalent Rust representation, or emit a more graceful unsupported-feature diagnostic without failing the whole function translation unexpectedly.Environment