mir icon indicating copy to clipboard operation
mir copied to clipboard

[MIR] Undeclared name inff

Open edubart opened this issue 2 years ago • 1 comments

MIR text generated by C2M doesn't compile when using INFINITY macro

Test case:

#include <math.h>
#include <stdio.h>

int main() {
    printf("%f\n", INFINITY);
    return 0;
}

Output:

$ c2m -w t.c -eg
inf
$ c2m -w -S t.c
$ c2m t.mir -eg
ln 8: undeclared name inff

edubart avatar Sep 20 '21 18:09 edubart

Thank you for reporting this. I'll need to think how to fix it. It is basically how to express infinity and nans in MIR, probably by using some reserved names.

vnmakarov avatar Sep 22 '21 16:09 vnmakarov