I know the other turn signals, but what if I need to flash the hazard? On a car it is both turn signals, but on a bike stretching both arms is stupid.
There are a few different hand signals to use depending on what the situation is.
In general, making a fist behind your back or with your elbow out and bent downward signals to other riders that you are planning on making a stop, potentially a very sudden stop for unexpected reasons; When closing in on road hazards, pointing them out is extremely helpful to the riders behind you, who in all likelihood can't see the hazard directly in front of you and could be caught off guard by it.
When I see glass (/sharp stuff), I usually relay it to the group by pointing my hand at the ground and wiggling my fingers, indicating something sharp is scattered on the ground.
With a moving motor vehicle, drivers would activate their hazard lights if they need to come to a stop.
If you're a lone cyclist and you need to signal to other vehicles (including cars and bicycles) around you, Scott's answer is correct (use the two accepted hand signals for a stop). That said, be sure to maintain control of your bicycle first. If you need to sudden stop, you just have to brake and hope for the best - although you can try to move off the road or otherwise out of traffic as you stop.
In a group ride, when you are operating in close proximity to others, here is how I'd signal a hazard:
- A verbal call of "STOPPING", as advised in this answer in a slightly different context, will signal the group that everyone should stop. You should consider calling repeatedly. In this context, it would not be necessary to use a hand signal, since everyone else understands you need to brake. Also, if you need to stop, you would prefer to have both hands on the handlebars.
- Equally important: riders behind the person stopping need to echo the call down the paceline. Riders at the back of the paceline will not be able to clearly hear a stop call from the front. You want people behind you to be aware of the hazard as soon as possible. Not every single rider needs to echo the call. In my experience, every 3rd or 4th rider echoing a stop call will suffice. If I'm towards the rear, I like to use a hand signal as well to signal to other traffic approaching from the rear that the group is stopping (i.e. cars obviously won't have heard the call to stop). However, wherever you are, your first priority is to maintain control of your bicycle (in aviation, "aviate, navigate, communicate" is a formal statement of the same principle, although in this context navigation isn't relevant for cyclists). If you are unable to signal for whatever reason (even if it's just that you're surprised), you will need to trust that others around you can communicate the signal to the back.
- If I'm stopping for a flat tire or other mechanical, I often call out "flat" or sometimes "mechanical". The latter term is likely to be understood by road racers, but I'm not sure it's universally used, and it's four syllables. As discussed on a Cyclingtips article someone else linked, a raised arm will be understood by many road racers, but I don't think all riders will necessarily understand.
Cars may also use their hazard lights to indicate that they are moving, but much slower than traffic would normally expect, e.g. flat tire or other damage. There isn't clearly an equivalent signal in cycling. You might consider using the "waving on" gesture (as in wave your arm forward, as if to say something like "go around me"). Cyclists can often tell from observation if you are limiting your speed due to some technical issue.
You don't really have the same need for hazard signals on a bicycle as you do on a car, since aside from losing your brakes (in which case, you probably need to keep your hands on the bar), every situation where you would use your hazards is irrelevant to the cyclist [You'd likely just pull over and stop]. You can yell or flash your headlight if you want to, since this is probably more recognizable than a hand signal which isn't right/left turn or stop to most people.
The primary hazard concern would be in group rides to point out road hazards (a problem also faced by motorcyclists).
On a motorcycle, its pointing down to the left at a 45 degree angle for a hazard to the left and pointing overhand for right (or kicking out the appropriate leg). Some people use it while biking but I don't really see it as a particularly useful hand signal to remember - I could see it being confused with left turn. Here are some other signals for road hazards in group rides.