If an announcement is made and the parents can prove that the passengers were well aware their child had an anaphylactic reaction to peanuts, and someone purposely exposed said child and child then coded...well I wouldn't want to be on the receiving end of that lawsuit or criminal charges.
I think you have hit on one reason people get so testy about this whole thing. The thought that someone could be held legally responsible for harming someone else simply by eating their own, perfectly legal and normal snack is, sadly, not as far fetched as it ought to be and it is ridiculous.
Let's go back to the man who was banned from future RyanAir flights when the peanuts he ate caused an anaphylatic reaction in a young passenger near him.
This man was a non native English speaker who did not understand verbal announcements about not eating peanuts and had no real reason to believe the announcements being made were anythign other than the normal and basic flight safety, and "drink service will be starting soon" types of things. He had been served peanuts on a prior flight so had no reason to think they were not appropriate flight food. He was totally minding his own business and having a simple snack and then was suddenly made to feel that he was to blame for this medical issue and also lost the ability to fly with the carrier in the future. How is that right or fair? How is it OK for the family of the child with an allergy to place that kind of responsibility and guilt on perfect strangers?
What if someone does not speak English or speak it well enough to follow such a random announcement in a hard to hear environment (as happened above)?
What if he A/V system on the flight (or speaker in one section of the aircraft) is such that announcements are garbled and the passengers cannot understand it? (I had that on my most recent flight)
What if a passenger is deaf and does not hear?
What if a passenger is tired and not really focusing on those preflight things and misses hearing the announcement?
What if a passenger does not realize there are nuts in the snack mix or granola bar they have with them?
etc, etc---I think it is patently wrong to hold other people, total strangers, with no real warning and only the most basic ways of informing them, responsible for the life and death safety of a child; especially when the child can die from the stranger simply eating a common snack.