Randall Gellens wrote:
At 9:09 AM -0700 4/27/05, Ken A wrote:
pop_pass.c: In function `check_password':
pop_pass.c:1365: warning: passing arg 1 of `strlen' makes pointer from integer without a cast
pop_pass.c:1365: warning: passing arg 1 of `__builtin_strcmp' makes pointer from integer without a cast
pop_pass.c:1365: warning: passing arg 1 of `strlen' makes pointer from integer without a cast
pop_pass.c:1365: warning: passing arg 1 of `__builtin_strcmp' makes pointer from integer without a cast
pop_pass.c:1365: warning: passing arg 1 of `__builtin_strcmp' makes pointer from integer without a cast
pop_pass.c:1365: warning: passing arg 1 of `__builtin_strcmp' makes pointer from integer without a cast
I get the same warnings on SunOS. Looking into it a bit more, it appears that, even though unistd.h is being included, the prototype for crypt() is never hit. The SunOS unistd.h has two prototypes for crypt(), both guarded by
#if (defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 >= 4)) || \ defined(__EXTENSIONS__)
I'm not sure why there are two, but it seems that both are skipped.
The warnings are annoying, but not serious. Still, it would be nice to fix this.
Can you check /usr/include/unistd.h on your platform and see what the crypt() prototype looks like and if it is guarded by #ifdef conditions?
Yep:
--- snip ---
/* XPG4.2 specifies that prototypes for the encryption functions must
be defined here. */
#ifdef __USE_XOPEN
/* Encrypt at most 8 characters from KEY using salt to perturb DES. */
extern char *crypt (__const char *__key, __const char *__salt)
__THROW __nonnull ((1, 2));/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt block in place. */ extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
/* Swab pairs bytes in the first N bytes of the area pointed to by FROM and copy the result to TO. The value of TO must not be in the range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM is without partner. */ extern void swab (__const void *__restrict __from, void *__restrict __to, ssize_t __n) __THROW __nonnull ((1, 2)); #endif
--- snip ---
Ken
