# translate-c: Prevent mistranslation of fp literals · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/7c3896e6cd20a51e63a018fd2e05ea3c552b7401)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 7c3896e6cd20a51e63a018fd2e05ea3c552b7401

Requested commit: 7c3896e6cd20a51e63a018fd2e05ea3c552b7401

Commit: 7c3896e6cd20a51e63a018fd2e05ea3c552b7401

Tree: 00900f2c69d30bec5965610d19966a1e17214980

Author: LemonBoy

Committer: LemonBoy

## Message

```
translate-c: Prevent mistranslation of fp literals

When trying to retrieve 80bit fp values from clang using
getValueAsApproximateDouble we'd eventually hit the ceiling value and
return infinity, an invalid value for a fp literal.

Add some logic to prevent this error and warn the user.

Closes #8602

```

## Parents

- [4ec6d174adc038741f1274d157f5253752eb8d51](https://git.cafe/gitcafe/zig/commit/4ec6d174adc038741f1274d157f5253752eb8d51?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/7c3896e6cd20a51e63a018fd2e05ea3c552b7401?format=markdown)
