Pelles C > Bug reports

#include <unistd.h> + <process.h> -> not compilable

(1/2) > >>

Fuerst:
Compiling the following C-Code ...

--- Code: ---#include <unistd.h>
#include <process.h>

int main(void)
{
return 0;
}

--- End code ---
... using Pelles-C 12.00.2 fails:

--- Quote ---O:\Sources\Test>pocc -Go test.c
C:\Program Files\PellesC\Include\process.h(99): error #2119: Redeclaration of 'execv', previously declared at C:\Program Files\PellesC\Include\unistd.h(85).
C:\Program Files\PellesC\Include\process.h(100): error #2119: Redeclaration of 'execve', previously declared at C:\Program Files\PellesC\Include\unistd.h(86).
C:\Program Files\PellesC\Include\process.h(101): error #2119: Redeclaration of 'execvp', previously declared at C:\Program Files\PellesC\Include\unistd.h(87).
--- End quote ---

TimoVJL:
Those headers are normally not used same time.

https://en.wikipedia.org/wiki/Process.h

Vortex:

--- Quote ---In the C and C++ programming languages, unistd.h is the name of the header file that provides access to the POSIX operating system API.
--- End quote ---

https://en.wikipedia.org/wiki/Unistd.h

https://copyprogramming.com/howto/is-there-a-replacement-for-unistd-h-for-windows-visual-c

frankie:
Bug confirmed.
The 3 functions are declared differently in the two headers:

--- Code: ---// process.h
extern intptr_t __cdecl execv(const char *, char * const []);
extern intptr_t __cdecl execve(const char *, char * const [], char * const []);
extern intptr_t __cdecl execvp(const char *, char * const []);

--- End code ---


--- Code: ---// unistd.h
extern intptr_t __cdecl execv(const char *, const char * const []);
extern intptr_t __cdecl execve(const char *, const char * const [], const char * const []);
extern intptr_t __cdecl execvp(const char *, const char * const []);

--- End code ---

TimoVJL:
It seems, that headers was mixed together.
From docs:

--- Code: ---// process.h
extern intptr_t __cdecl execv(const char *, const char * const []);
--- End code ---
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/execv-wexecv?view=msvc-170


--- Code: ---// unistd.h
extern intptr_t __cdecl execv(const char *, char * const []);
--- End code ---
https://linux.die.net/man/3/execv

Navigation

[0] Message Index

[#] Next page

Go to full version