Whole-wheat flour, unlike white flour, still contains the germ when it is milled. That means it has some natural oils in it, and those oils can go off. Give your bag of whole-wheat flour a whiff; if it gives off a pronounced sour note, discard it. I recommend buying whole-wheat flour in small quantities in bulk and storing it in your freezer.