* netinet/in.h broken for C++?
@ 1997-04-25 13:55 Christian Czezatke
0 siblings, 0 replies; only message in thread
From: Christian Czezatke @ 1997-04-25 13:55 UTC (permalink / raw)
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 <netinet/in.h>
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1997-04-25 13:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-04-25 13:55 netinet/in.h broken for C++? Christian Czezatke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox