Are restuarants required to put on the menu warnings like for someone that has cashew allergy?

No. There is no law requiring that. As a consumer with allergies, it is your responsibility to ask. There are many allergies and no restaurant can be expected to make food hypo-allergenic to everyone. But if you ask, they should be able to tell you the ingredients and warn you beforehand. If not, ask the chef. If still unsure or no response, then leave for your own safety.