apr 1.6.5 warnings that probably should be fixed 2018-12-31 SHL file_io/os2/dir.c:64:8: warning: implicit declaration of function 'access'; did you mean 'accept'? [-Wimplicit-function-declaration] if(access(dirname, F_OK) != 0) return APR_ENOENT; accept * Add #include file_io/os2/filestat.c:136:25: warning: implicit declaration of function 'apr_unix_mode2perms'; did you mean 'apr_uid_compare'? [-Wimplicit-function-declaration] finfo->protection = apr_unix_mode2perms(info->st_mode); ^~~~~~~~~~~~~~~~~~~ apr_uid_compare Add #include "../unix/apr_arch_file_io.h" or add apr_unix_mode2perms() to os2/apr_arch_file_io.h file_io/os2/../unix/mktemp.c:71:23: warning: implicit declaration of function 'srandom'; did you mean 'seedrandom'? [-Wimplicit-function-declaration] #define seedrandom(a) srandom(a) ^~~~~~~ seedrandom(randseed); ^~~~~~~~~~ * Add #include file_io/os2/../unix/mktemp.c:70:22: warning: implicit declaration of function 'random'; did you mean 'rindex'? [-Wimplicit-function-declaration] #define arc4random() random() ^~~~~~ randnum = arc4random() % (sizeof(padchar) - 1); ^~~~~~~~~~ * Add #include file_io/os2/open.c:36:9: warning: implicit declaration of function 'close'; did you mean 'pclose'? [-Wimplicit-function-declaration] if (close(file->filedes) == 0) { ^~~~~ pclose * Add #include file_io/os2/open.c:39:13: warning: implicit declaration of function 'unlink' [-Wimplicit-function-declaration] unlink(file->fname); ^~~~~~ * Add #include file_io/os2/readwrite.c:111:38: warning: passing argument 2 of 'DosResetEventSem' from incompatible pointer type [-Wincompatible-pointer-types] DosResetEventSem(thefile->pipeSem, &post_count); ^~~~~~~~~~~ from ./include/apr.h:192, from ./include/apr_pools.h:43, from ./include/arch/unix/../apr_private_common.h:24, from ./include/arch/unix/apr_private.h:1019, from U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_file_io.h:20, from file_io/os2/readwrite.c:20: ULONG APIENTRY DosResetEventSem (HEV hev, PULONG pulCount); ~~~~~~~^~~~~~~~ * Change post_count from into to unsigned long file_io/os2/readwrite.c:112:48: warning: passing argument 4 of 'DosRead' from incompatible pointer type [-Wincompatible-pointer-types] rc = DosRead(thefile->filedes, buf, *len, &nbytes); ^~~~~~~ from ./include/apr.h:192, from ./include/apr_pools.h:43, from ./include/arch/unix/../apr_private_common.h:24, from ./include/arch/unix/apr_private.h:1019, from U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_file_io.h:20, from file_io/os2/readwrite.c:20: PULONG pulBytesRead); ~~~~~~~^~~~~~~~~~~~ * Change nbytes to unsigned long file_io/os2/readwrite.c:167:69: warning: passing argument 4 of 'SafeDosSetFilePtr' from incompatible pointer type [-Wincompatible-pointer-types] DosSetFilePtr(thefile->filedes, offset, FILE_BEGIN, &thefile->filePtr ); ^~~~~~~~~~~~~~~~~ from ./include/apr.h:192, from ./include/apr_pools.h:43, from ./include/arch/unix/../apr_private_common.h:24, from ./include/arch/unix/apr_private.h:1019, from U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_file_io.h:20, from file_io/os2/readwrite.c:20: ULONG APIENTRY DosSetFilePtr (HFILE hFile, LONG lOffset, ULONG ulOrigin, PULONG pulPos); ~~~~~~~^~~~~~ * Cast thefile->filePtr to to unsigned long * Changing filePtr to unsigned long is probably too intrusive file_io/os2/readwrite.c:192:13: warning: implicit declaration of function 'isatty'; did you mean 'isset'? [-Wimplicit-function-declaration] if (isatty(thefile->filedes) ^~~~~~ isset * Add #include file_io/os2/readwrite.c:197:30: warning: implicit declaration of function '_lmalloc'; did you mean '_tmalloc'? [-Wimplicit-function-declaration] pvBuf_safe = _lmalloc(*nbytes); ^~~~~~~~ _tmalloc * Add #include or * Add #include and change to _tmalloc * _lmalloc and _tmalloc both allocate from the same heap file_io/os2/readwrite.c:197:28: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion] pvBuf_safe = _lmalloc(*nbytes); ^ * Add #include or * Add #include and change to _tmalloc * _lmalloc and _tmalloc both allocate from the same heap file_io/os2/readwrite.c:208:30: warning: implicit declaration of function 'alloca' [-Wimplicit-function-declaration] pvBuf_safe = alloca(*nbytes); ^~~~~~ * Add #include or file_io/os2/readwrite.c:208:30: warning: incompatible implicit declaration of built-in function 'alloca' file_io/os2/readwrite.c:308:16: warning: implicit declaration of function 'write'; did you mean 'fwrite'? [-Wimplicit-function-declaration] written = write(thefile->filedes, thefile->buffer, thefile->bufpos); ^~~~~ fwrite * Add #include file_io/os2/seek.c:45:63: warning: passing argument 4 of 'SafeDosSetFilePtr' from incompatible pointer type [-Wincompatible-pointer-types] rc = DosSetFilePtr(thefile->filedes, pos, FILE_BEGIN, &thefile->filePtr ); ^~~~~~~~~~~~~~~~~ from ./include/apr.h:192, from ./include/apr_pools.h:43, from ./include/arch/unix/../apr_private_common.h:24, from ./include/arch/unix/apr_private.h:1019, from U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_file_io.h:20, from file_io/os2/seek.c:17: ULONG APIENTRY DosSetFilePtr (HFILE hFile, LONG lOffset, ULONG ulOrigin, PULONG pulPos); ~~~~~~~^~~~~~ * Cast thefile->filePtr to to unsigned long * Changing filePtr to unsigned long is probably too intrusive memory/unix/apr_pools.c:411:17: warning: implicit declaration of function '_lmalloc'; did you mean 'malloc'? [-Wimplicit-function-declaration] if ((node = _lmalloc(size)) == NULL) ^~~~~~~~ malloc * Add #include or * Add #include and change to _tmalloc * _lmalloc and _tmalloc both allocate from the same heap memory/unix/apr_pools.c:411:15: warning: assignment to 'apr_memnode_t *' {aka 'struct apr_memnode_t *'} from 'int' makes pointer from integer without a cast [-Wint-conversion] if ((node = _lmalloc(size)) == NULL) ^ from network_io/os2/../unix/inet_ntop.c:18, from network_io/os2/inet_ntop.c:1: * Add #include or * Add #include and change to _tmalloc * _lmalloc and _tmalloc both allocate from the same heap U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp] #warning xxx ^~~~~~~ from network_io/os2/../unix/inet_pton.c:18, from network_io/os2/inet_pton.c:1: * I have no clue why someone added this warning to apr_arch_os2calls.h U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp] #warning xxx from network_io/os2/os2calls.c:17: * I have no clue why someone added this warning to apr_arch_os2calls.h U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp] #warning xxx ^~~~~~~ from network_io/os2/sendrecv.c:17: * I have no clue why someone added this warning to apr_arch_os2calls.h U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp] #warning xxx ^~~~~~~ from network_io/os2/sendrecv_udp.c:17: * I have no clue why someone added this warning to apr_arch_os2calls.h U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp] #warning xxx ^~~~~~~ from network_io/os2/../unix/sockaddr.c:17, from network_io/os2/sockaddr.c:2: * I have no clue why someone added this warning to apr_arch_os2calls.h U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp] #warning xxx ^~~~~~~ * I have no clue why someone added this warning to apr_arch_os2calls.h network_io/os2/../unix/multicast.c:165:28: warning: passing argument 4 of 'apr_os2_setsockopt' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] (const void *) &mip4, sizeof(mip4)) == -1) { ^~~~~~~~~~~~~~~~~~~~ * Probably should add const to declaraction in apr_arch_os2calls.h just to get rid of warning network_io/os2/../unix/multicast.c:208:24: warning: passing argument 4 of 'apr_os2_setsockopt' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] (const void *) &value, sizeof(value)) == -1) { ^~~~~~~~~~~~~~~~~~~~~ * Probably should add const to declaraction in apr_arch_os2calls.h just to get rid of warning network_io/os2/../unix/multicast.c:292:24: warning: passing argument 4 of 'apr_os2_setsockopt' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] (const void *) &iface->sa.sin.sin_addr, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ from network_io/os2/sockets.c:17: * Probably should add const to declaraction in apr_arch_os2calls.h just to get rid of warning U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp] #warning xxx ^~~~~~~ from network_io/os2/sockopt.c:17: * I have no clue why someone added this warning to apr_arch_os2calls.h U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp] #warning xxx ^~~~~~~ from poll/os2/poll.c:19: * I have no clue why someone added this warning to apr_arch_os2calls.h U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp] #warning xxx ^~~~~~~ from ./include/apr_poll.h:24, from poll/os2/poll.c:18: * I have no clue why someone added this warning to apr_arch_os2calls.h In file included from ./include/apr_pools.h:44, from ./include/apr_poll.h:24, from poll/os2/poll.c:18: poll/os2/poll.c: In function 'apr_pollcb_method_name': ./include/apr_errno.h:476:28: warning: returning 'int' from a function with return type 'const char *' makes pointer from integer without a cast [-Wint-conversion] #define APR_ENOTIMPL (APR_OS_START_STATUS + 23) ^ return APR_ENOTIMPL; ^~~~~~~~~~~~ from poll/os2/pollset.c:19: * apr_pollcb_method_name() shoud probably return NULL or maybe "NOT_IMPLEMENTED" * A non-zero value could cause a crash * Since apr_pollcb_create_ex returns APR_ENOTIMPL, apr_pollcb_method_name() * should probably never be called. U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp] #warning xxx ^~~~~~~ * I have no clue why someone added this warning to apr_arch_os2calls.h poll/os2/pollset.c:221:18: warning: implicit declaration of function 'alloca' [-Wimplicit-function-declaration] pollresult = alloca(sizeof(int) * pollset->num_total); ^~~~~~ * Add #include or poll/os2/pollset.c:221:18: warning: incompatible implicit declaration of built-in function 'alloca' from support/unix/waitio.c:18: U:/DEV/apr-1.6.5/include/arch/os2/apr_arch_os2calls.h:19:2: warning: #warning xxx [-Wcpp] #warning xxx ^~~~~~~ * I have no clue why someone added this warning to apr_arch_os2calls.h threadproc/os2/proc.c:239:9: warning: implicit declaration of function 'apr_random_after_fork'; did you mean 'apr_proc_mutex_lock'? [-Wimplicit-function-declaration] apr_random_after_fork(proc); ^~~~~~~~~~~~~~~~~~~~~ apr_proc_mutex_lock threadproc/os2/thread.c:78:19: warning: assignment to 'apr_status_t' {aka 'int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion] thread->exitval = thread->func(thread, thread->data); ^