Mail Archives: geda-user/2014/09/24/00:05:51
Kai-Martin Knaak wrote:
> read.c: In function 'try_read_ci_chars':
> read.c:983:3: warning: implicit declaration of function 'alloca' [-Wimplicit-function-declaration]
> char *chars_read = alloca (num_chars_wanted);
> ^
> read.c:983:22: warning: incompatible implicit declaration of built-in function 'alloca'
> char *chars_read = alloca (num_chars_wanted);
> ^
This is ugly but if void * and int are the same size it is harmless.
MSDN says the correct header file is malloc.h and that the function
is called _alloca() as opposed to alloca(). Try including the header
and adding a conditional define, into all source files with that
warning.
#include <malloc.h>
#ifndef alloca
#define alloca _alloca
#endif
> posix.c: In function 'scm_execl':
> posix.c:1144:3: warning: passing argument 2 of 'execv' from incompatible pointer type
> execv (exec_file, exec_argv);
> ^
> In file included from /usr/local/src/mxe/usr/i686-pc-mingw32.static/include/unistd.h:13:0,
> from ../lib/unistd.h:40,
> from posix.c:50:
> /usr/local/src/mxe/usr/i686-pc-mingw32.static/include/process.h:118:42: note: expected 'const char * const*' but argument is of type 'char **'
> _CRTIMP intptr_t __cdecl __MINGW_NOTHROW execv (const char*, const char* const*);
> ^
These are harmless, it's a mismatch between const and non-const. When
the function takes const and a non-const is passed, there's no problem.
> From my scarce coding experiences long long ago "incompatible pointer
> type" and "incompatible implicit declarations" ring a serious bell.
In principle correct, but when the only difference is const vs
non-const it's not so bad.
//Peter
- Raw text -