The fact that a person who is so hungry that he fears for his life is allowed to eat even forbidden types of food only shows that Islam asks for what is easy, and always gives situations of necessity the sort of rulings which ensure that no affliction is caused to its followers. In the end, matters are left to the clear intention and to being conscious of what Allah requires of us.
A person, who is driven by an extreme situation to eat of these forbidden types having had no intention of committing a sin, will suffer no punishment.