Quantcast
Channel: User CPlus - Programming Language Design and Implementation Stack Exchange
Viewing all articles
Browse latest Browse all 65

Why would a language need to have trap representations?

$
0
0

In C there is a concept of trap representations, or non-value representations. If such a value is produced or used, immediate undefined behavior is invoked. This is one of the dangers of using uninitialized memory as there might be a trap representation.

However, for what reason would a language or implementation have a concept of a trap representation in the first place? Why would the behavior not be defined every one of the finite number of possible values of the finite number of bits in a type?


Viewing all articles
Browse latest Browse all 65

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>