This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Declaration of crypt


According to Posix, including <unistd.h> should bring in the declaration of crypt. The glibc and FreeBSD headers are consistent with this, but Cygwin's aren't.

$ cat test.c
#include <unistd.h>

int
main (void)
{
  const char *key = NULL;
  const char *salt = NULL;
  crypt (key, salt);
}

$ gcc -c test.c
test.c: In function âmainâ:
test.c:8:3: warning: implicit declaration of function âcryptâ [-Wimplicit-function-declaration]
   crypt (key, salt);
   ^

The attached patch is one way to fix this. It means that cygwin-devel would have to require libcrypt-devel.

I'm not sure if I used the right feature-test macro in the patch. It's marked XSI by Posix, but using __XSI_VISIBLE didn't work.

Ken

P.S. Is cygwin-patches OK for this sort of thing, or should I have sent it to the newlib list?

Attachment: 0001-Make-unistd.h-declare-crypt.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]