Not to warn of a speed trap specifically, but just 'to warn someone'. If he had a relatively decent lawyer I'm sure this could have been used to his advantage.
It's not to "warn someone"
It's to let other road users know you are there, If you feel they haven't seen you.