Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSYS2 GCC problem with Linux types #1270

Open
d3vv opened this issue May 26, 2018 · 1 comment
Open

MSYS2 GCC problem with Linux types #1270

d3vv opened this issue May 26, 2018 · 1 comment

Comments

@d3vv
Copy link

@d3vv d3vv commented May 26, 2018

Compile a small example with warning enable by:

gcc -Wold-style-cast msyswarn.cpp

#include <sys/select.h>

int main(int argc, char *argv[])
{
	fd_set read_fd;

	FD_ZERO(&read_fd);

	return 0;
}

we have a warning on msys2:

In file included from msyswarn.cpp:1:0:
msyswarn.cpp: In function ‘int main(int, char**)’:
msyswarn.cpp:7:11: warning: use of old-style cast [-Wold-style-cast]
  FD_ZERO(&read_fd);
           ^

There is no such warnings on my CentOS, Debian and Gentoo..

This is not only warning - this is a difference with Linux types which produce a bogus code on msys in real projects with debug hell for investigation.

And but what is a problem? If from Linux man:

       /* According to POSIX.1-2001, POSIX.1-2008 */
       #include <sys/select.h>

       /* According to earlier standards */
       #include <sys/time.h>
       #include <sys/types.h>
       #include <unistd.h>

       int select(int nfds, fd_set *readfds, fd_set *writefds,
                  fd_set *exceptfds, struct timeval *timeout);

       void FD_CLR(int fd, fd_set *set);
       int  FD_ISSET(int fd, fd_set *set);
       void FD_SET(int fd, fd_set *set);
       void FD_ZERO(fd_set *set);

       #include <sys/select.h>

       int pselect(int nfds, fd_set *readfds, fd_set *writefds,
                   fd_set *exceptfds, const struct timespec *timeout,
                   const sigset_t *sigmask);
@Alexpux
Copy link
Member

@Alexpux Alexpux commented May 30, 2018

@d3vv probably you need ask on Cygwin mailing list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants