> Where does a compiler _usually_ perform checks on the size of> integers and strings ?>> For example. If a user declares a variable as an "int" in the source> code, and assigns it some 50 digit number (or any number, exceeding> the size of an int).>> Is this sort of error detected by the lexer or by the type checker, or ?

In your example, the sizeof(int) can differ for every target machine.
That's why such checks typically occur in the code generator, or in the
preceding optimizer. The optimizer can remove dead code, so that an
overflow or similar error detection in dead code is not required before
that stage, at least.