The other answers already told you about exhaustion, I can tell you firsthand how dangerous cramps could be.
I was swimming together with my former girlfriend in Ustka, Poland on the coast of the Baltic Sea. I would say that I am an average swimmer with a good constituition so I can swim several kilometers and I never had cramps before.
There was no warning when suddenly my right leg was strongly cramping. I was thrown out of balance by the unexpected shift and swallowed some water.
Now there are two things about Ustka: The beach has an extremely gentle slope so you can walk out hundred meter and you are still standing. The other is that the water is brackish water, it does not sting and it causes no coughing. Luckily I was still in standing depth, 1.7 m and therefore it was not a problem. The sea was also calm.
Being curious by nature and being safe, I tried out to stay afloat with the cramping leg and simulated that my other leg could not move either. Yes, you can stay afloat, but it took me several minutes to master it. Essentially I must submerge my body almost completely, breathe deeply and put my body in a relaxing position. If you are able to dive, you could pull your toes to your body to loose the cramps.
So I could stay afloat, but what now?
Every time I tried to raise my arm (I did not raise it fully because I did not want to alert any guards), my body was submerged and I could not breathe anymore. It puts me out of the relaxing position and every time it was hard to get again in the floating position. The same problem when I forcefully blew out air to simulate screaming, I sank and I often lost the necessary coordination to stay afloat
I could not move. For someone who does not experience it, it is very hard to imagine how strongly the movement is inhibited. You need the legs to balance yourself, without them you cannot execute effective swimming movements anymore.
So essentially I cannot scream, I cannot alarm people and I cannot move.
The whole thing was problematic enough with one leg cramping, I was feeling like a turtle on the back, if the whole thing would be realistic, I would have drown. And I would say that if the leg really cramps the first time, you are not able to move correctly to stay afloat.
ADDITION: @Headcrab pointed exactly out what I want to warn against: You are deluding yourselves if you think it is the same if you are in the swimming pool and simulate cramps by holding the legs stretched. Sure, that is also easy for me: Simply blow yourself up as much as possible and scream and move your arms as you like. It does not work this way.
It is very hard to describe what exactly is happening, but I do my best to explain it: Even if you do not move, your brain is in control of your extremities and can anticipate the correct movements to float. So it can balance out problems almost subconsciously. Once your leg cramps, your brain cannot anticipate your leg movement nor can it correct it, so you lose your balance almost immediately (which resulted that I swallowed water). In this case your brain almost immediately switches to "RED ALERT" and you are prone to panic which is not a good thing. After finding ground immediately (I knew that, but your brain needs reassurance), the panic ceased, but the lingering impression how fast you can lose control is still on my mind.
The cramping leg caused that I need to use my torso muscles to hold the leg up (you need to lie on your back to put your mouth and nose on top) and in an unusual position; I was lying lower in the water than normally. Also I needed to regulate my position actively and clumsily to hold my balance and I really needed time to allow my brain to adjust to the new conditions; if I make too strong moves, I lose my balance. As my left leg was only "simulating", the water was calm and not irritating, the real condition with two legs crampings could be only much worse.
As muscle tissue is denser as water and I was really almost submerged, I am inclined to believe that a more muscular man than me cannot simply hold himself up. Having different body types, other people may experience it different, but for me neither screaming nor waving was possible without submerging again.