Sponsored Content
Full Discussion: gethostname warning
Top Forums Programming gethostname warning Post 302318091 by paulquater on Wednesday 20th of May 2009 06:45:38 PM
Old 05-20-2009
gethostname warning

Hi, does anyone knows how to get rid of this annoying warning? Thank you!

Code:
#include <netdb.h>
main()
{
    gethostbyname("test");
}

$ gcc -static test.c
/tmp/ccW9HG18.o: In function `main':
test.cSmilie.text+0x19): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

$ nm a.out | grep gethostbyname
0804f660 T __gethostbyname_r
0804f660 T __new_gethostbyname_r
080500b0 T __nscd_gethostbyname2_r
08050110 T __nscd_gethostbyname_r
0804f4a0 T gethostbyname
0804f660 W gethostbyname_r


-----

$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
 

We Also Found This Discussion For You

1. Programming

regarding gethostname()

i used stuct hosent h; h=gethostname("google.com"); if(h==NULL) printf("net down"); else printf("net down"); my question hoe this gethostname will verify whether net ia active or inactive i eman whether by usin ping or sending socket . if it is socket which type of socket it is... (5 Replies)
Discussion started by: phani_sree
5 Replies
TIFFWarning(3T) 														   TIFFWarning(3T)

NAME
TIFFWarning, TIFFSetWarningHandler - library warning interface SYNOPSIS
#include <tiffio.h> void TIFFWarning(const char* module, const char* fmt, ...) #include <stdargh.h> typedef void (*TIFFWarningHandler)(const char* module, const char* fmt, va_list ap); TIFFWarningHandler TIFFSetWarningHandler(TIFFWarningHandler handler); DESCRIPTION
TIFFWarning invokes the library-wide warning handler function to (normally) write a warning message to the stderr. The fmt parameter is a printf(3S) format string, and any number arguments can be supplied. The module parameter is interpreted as a string that, if non-zero, should be printed before the message; it typically is used to identify the software module in which a warning is detected. Applications that desire to capture control in the event of a warning should use TIFFSetWarningHandler to override the default warning han- dler. A NULL(0) warning handler function may be installed to suppress error messages. RETURN VALUES
TIFFSetWarningHandler returns a reference to the previous error handling function. SEE ALSO
libtiff(3T), TIFFError(3T), printf(3S) October 15, 1995 TIFFWarning(3T)
All times are GMT -4. The time now is 05:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy