This is actually something I know a little about, at least how it's handled in my country, Norway, and it's probably handled the same way throughout Northern Europe at least.
In Norway you will not be forcibly fed if you stop eating while at an institution. Doing that would constitute breach of your human rights. But the state will monitor your health and they will continue to offer you food at mealtimes. The staff will continue to watch you and they have instructions to look for certain signs, like when your body starts to smell like acetone. When that happens they have to call for a doctor. The doctor will then asses your situation and might take action. A loop hole with the law is that when you lose your consciousness, then the doctor are legally allowed to treat you the way he sees fit since you are no longer able to give him instructions. He probably has to assume you want to live.
Edit:
To clearify my point: The first days of a hunger strike is not dangerous and you are not in mortal danger. Then the prison/hospital has no statutory authority to do anything. But when your body starts to die they can invoke necessity. But then there are strict guidelines on what they can do.