2014-07-22 23:37 GMT+02:00 Ray Donnelly <[email protected]>:

> Hello,
>
> While porting msysGit to MSYS2/MinGW-w64 we ran into this:
>
> $ PATH=/mingw64/bin:"$PATH" gcc --version
> gcc.exe (Rev1, Built by MSYS2 project) 4.9.1
>
> $ cat test.c
> #include <unistd.h>
> static inline pid_t fork(void);
> void main() {}
>
> $ PATH=/mingw64/bin:"$PATH" gcc test.c
> test.c:2:21: warning: conflicting types for built-in function 'fork'
>  static inline pid_t fork(void);
>                      ^
>
> Anyone got any ideas about this?
>

GCC has a number of builtin functions like printf, memcpy, and a bunch of
math functions as well. This is mostly for optimization  It seems it also
has a builtin "fork", which it really should disable for Windows targets,
but doesn't. I'd file a bug report, GCC shouldn't have a builtin fork on
Windows.

Also note that main should return int, not void. The latter is technically
undefined behavior.

Cheers,

Ruben


> Best regards,
>
> Ray.
>
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to