Article View: comp.unix.programmer
Article #3603gethostname() with -pedantic -ansi flags
From: Jeff Shipman
Date: Tue, 04 Apr 2000 00:00
Date: Tue, 04 Apr 2000 00:00
20 lines
1794 bytes
1794 bytes
Sorry if this is not the correct newsgroup to post to. I wasn't sure which one would be right. My problem is that I'm compiling my program with the -pedantic and -ansi flags and I get the following warning: cb.c:348: warning: implicit declaration of function `gethostname' I am including unistd.h and it compiles just fine if I leave out those two flags. Is it because gethostname() is not ANSI C? If so, I'm also using a lot of GTK code in there, it's not ANSI C, and the compiler doesn't seem to mind...is there something I'm not getting? Thanks in advance. -- +-----------------------------------------------------+ | Jeff "Shippy" Shipman E-Mail: shippy@cs.nmt.edu | | Computer Science Major ICQ: 1786493 | | New Mexico Institute of Mining and Technology | | Homepage: http://www.nmt.edu/~shippy | +-----------------------------------------------------+
Technical Details
Message-ID:
<38EA826B.74E7DECA@cs.nmt.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,98a1efd33b1208fc,start X-Google-Attributes: gid11318c,public X-Google-Thread: fc89c,98a1efd33b1208fc,start X-Google-Attributes: gidfc89c,public X-Google-Thread: 1014db,98a1efd33b1208fc,start X-Google-Attributes: gid1014db,public From: Jeff Shipman <shippy@cs.nmt.edu> Subject: gethostname() with -pedantic -ansi flags Date: 2000/04/04 Message-ID: <38EA826B.74E7DECA@cs.nmt.edu> X-Deja-AN: 606815720 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@nmt.edu X-Trace: newshost.nmt.edu 954892787 83270 129.138.5.96 (4 Apr 2000 23:59:47 GMT) Organization: New Mexico Institute of Mining and Technology Mime-Version: 1.0 NNTP-Posting-Date: 4 Apr 2000 23:59:47 GMT Newsgroups: comp.unix.programmer,comp.lang.c,gnu.gcc.help