티스토리 뷰

gcc 2.95.3에서 C++ 소스를 컴파일중, 다음과 같은 오류메시지가 뜨게된다
/usr/include/netinet/in.h:212: warning: ANSI C++ forbids data member `ip_opts' with same name as enclosing class


/usr/include/netinet/in.h 파일을 열고 212번째 쯔음에 있는 다음 내용을 고친다.

(위 파일에 이 내용이 없는 경우 /usr/include/bits/in.h를 연다.)

struct ip_opts {
struct in_addr ip_dst; /* first hop, 0 w/o src rt */
int8_t ip_opts[40]; /* actually variable in size */
};

struct ip_opts {
struct in_addr ip_dst; /* first hop, 0 w/o src rt */
#if defined(__cplusplus)
char Ip_opts[40]; /* cannot have same name as class */
#else

char ip_opts[40]; /* actually variable in size */
#endif
};
로 고친다.

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함