From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <12854c83fbd5c328b8bce8ed16e2a59a.axp-list@archive.invalid> X-Archive-Original-Message-ID: <97042512343793@decus.fr> Date: Fri, 25 Apr 1997 12:55:35 -0100 (GMT+1) From: Christian Czezatke Subject: netinet/in.h broken for C++? Hi! I've ran into the following problem on Linux/Alpha (System is RH 4.0, Kernel 2.0.30 + axp-diffs-2.0.30): Consider the following code: ----------------------- #include void main(void) { unsigned short x, y; x = htons(y); } ----------------------- If you compile this code as plain C-Code, everything works just fine. However, compiling this program as C++ code (either by using "g++" or by renaming the file to "something.C") causes the compiler to emit the following warning message: test.c: In function `int main(...)': test.c:7: warning: implicit declaration of function `int htons(...)' This is not only true for "htons", but for all the byte-ordering helpers that exist (htonl, htons, ntohl, ntohs). I'd be glad if someone could point me to a clean fix that does not involve replacing the entire RH 4.0 installation on my box with RH 4.1.. ;-) thanks for your help! Christian -------------------------------------------------------------------- | Christian Czezatke, Student of Computer Science at the Vienna | | University Of Technology. | |------------------------------------------------------------------| | email: e9025461@student.tuwien.ac.at | -------------------------------------------------------------------- -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com