Unless your carry-on is extremely large, the airline employees at the gate most likely won't ask to measure it. If they'd ask each passenger to measure their carry-on, the boarding would take too long. This could cause delayed flights, which airlines don't want.