Hello GNU Global,
What is your environment (OS)?
Environment: Windows 11
Which version of Global are you using?
6.6.13
What did you do? (command line)
1. cd /path/to/gtags-cscope
2. make
What did you expect from it?
Building a gtags-cscope binary.
What was occurred? (as is)
exec.c: In function 'execute':
exec.c:92:39: error: passing argument 3 of 'spawnvp' from incompatible
pointer type [-Wincompatible-pointer-types]
92 | exitcode = spawnvp(P_WAIT, a, (const char* const*)argv);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| |
| const char * const*
I use GNU Global and I've found a bug of compilaton error on Windows. It
seems that latest mingw toolchain
has updated the declaration of spawnvp function in process.h like this:
_CRTIMP intptr_t __cdecl spawnve(int,const char *_Filename,char *const
_ArgList[],char *const _Env[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
I've changed the type casting from (const char* const*) to (char* const*) to
successfully build it. Another solution is to use the safer one:
_CRTIMP intptr_t __cdecl _spawnvp(int _Mode,const char *_Filename,const
char *const *_ArgList);
If using this one, just call _spawnvp and the type casting won't be changed.
Would you help update it? Thanks a lot!
Lambert,
Regards