What must be mandatory is the distance between the man holding the red flag on the side of the road and the actual danger.
Most of the times, the guy holding the flag is exactly at the place of the danger. We know driving is all about anticipation. Therefore, the man holding the flag must be something like 100 meters before the actual danger zone.
You are right the flag man should be indicate the danger in advance and not just as you reach the work zone. Most big companies do this and have gone a step ahead to use dummy flag man instead of a live person. However, the small time road maintenance contractors etc. seem to bother less. Some have a safety cone tied to the back of the truck on the road that they drag on as they move. If you miss to see the cone you are going to ram on to the truck.