Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Christian Czezatke <e9025461@student.tuwien.ac.at>
Subject: netinet/in.h broken for C++?
Date: Fri, 25 Apr 1997 12:55:35 -0100 (GMT+1)	[thread overview]
Message-ID: <12854c83fbd5c328b8bce8ed16e2a59a.axp-list@archive.invalid> (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

                 reply	other threads:[~1997-04-25 13:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox