Subject: Re: first-tests with 7.15.2-CVS

Re: first-tests with 7.15.2-CVS

From: Alexander Lazic <al-cares_at_none.at>
Date: 2006-01-07

On Fre 06.01.2006 23:35, Daniel Stenberg wrote:
>On Thu, 5 Jan 2006, Alexander Lazic wrote:
>
>>due the fact that the compiling is ok but the linking failed.
>
>Now this puzzles me.
>
>How come it can compile fine if it doesn't even have the function? To
>me, it sounds like the function is present in the header files but
>perhaps requires a lib or something that we don't detect/use proberly

Because there is only a warning and gcc returns with 0;

gcc -Wall -c -g -O2 get_r.c ;echo $?

get_r.c: In function `main':
get_r.c:75: warning: implicit declaration of function `getservbyport_r'
get_r.c:72: warning: 'p1' might be used uninitialized in this function
get_r.c:72: warning: 'p5' might be used uninitialized in this function
get_r.c:73: warning: 'p2' might be used uninitialized in this function
get_r.c:74: warning: 'p3' might be used uninitialized in this function
0
---get_r.c
#include <netdb.h>
int
main ()
{

      int p1, p5;
      char *p2, p4[4096];
      struct servent *p3, *p6;
      getservbyport_r(p1, p2, p3, p4, p5, &p6);

  ;
  return 0;
}

---
Hth
Alex
Received on Sat Jan 7 00:32:45 2006