Fixes #3973: Move r29904 to v1.7 branch (fix annoying flex warnings)

---svn-pre-commit-ignore-below---

r29904 [[BR]]
Fix some annoying flex warnings that have been there for years.

Many thanks to Tom Fogal for the initial patch.

cmr=v1.7.4:reviewer=rhc:subject=Fix annoying flex warnings