enumeration declaration

eclipse understands that function foodbar belongs to datatype food

Then it (or you) understand it all wrong. The function is declared to return a value of type food, which is an enum.

but foodbar returns something so it makes a warning.

Then, eclipse is wrong. Specifically, what warning?

also you could say that the foodbar functions returns a food variable

Again, you'd be wrong. It returns a value of type food, not a variable of type food. What you do with that value is up to you. You can store it in a variable of type food, or print it, or pass it to a function that expects a food.