It's usually a rule on a path or a sidewalk to warn before passing. There is no such rule on the road-- a vehicle is not required to warn before passing another vehicle. I only warn if the rider I'm about to pass is riding unpredictably. Still, some people expect it. On one ride, I passed a rider who was riding in the shoulder. I went all the way to the centerline to pass. And it was a wide lane, too. He still got upset at the lack of warning and yelled at me. Oh Well!