In /usr/include/netinet/in.h the structure ip_opts has a data member also named ip_opts. According to the ANSI C++ Standard (and from discussion on egcs) this is not allowed. When including this file in a C++ program, egcs flags this as an error. Since I don't know who's responsible for the include files in RedHat 5.1 (the glibc maintainer ?), please forward this report.
I have verified this to be true in 5.1 and also in 5.2. It is being assigned to a developer for further review.
This problem is fixed by the glibc 2.1 header files