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

Conflicting declarations of variable ipc_pollfunc_ptr #7

Closed
wferi opened this issue Dec 20, 2016 · 5 comments
Closed

Conflicting declarations of variable ipc_pollfunc_ptr #7

wferi opened this issue Dec 20, 2016 · 5 comments
Labels

Comments

@wferi
Copy link
Contributor

wferi commented Dec 20, 2016

Quoting a Debian bug report:

While building the package using our research compiler infrastructure we
noticed the following conflicting declarations:

  • ./lib/clplumbing/ipcsocket.c:extern int (*ipc_pollfunc_ptr)(struct pollfd *, nfds_t, int);
  • ./lib/clplumbing/ocf_ipc.c:int (*ipc_pollfunc_ptr)(struct pollfd*, unsigned int, int)

with nfds_t being unsigned long int. This may cause undefined behaviour if
values larger than UINT_MAX are passed to *ipc_pollfunc_ptr.

@krig krig added the bug label Dec 20, 2016
@dmuhamedagic
Copy link
Collaborator

dmuhamedagic commented Dec 20, 2016 via email

@wferi
Copy link
Contributor Author

wferi commented Dec 20, 2016

Ah, I didn't check. Good to know that it isn't causing problems now. Why don't you use the same type name to exclude any possibility of conflict?

@dmuhamedagic
Copy link
Collaborator

dmuhamedagic commented Dec 21, 2016 via email

@wferi
Copy link
Contributor Author

wferi commented Dec 21, 2016

The problem is the typedef provided by the system poll.h. Here /usr/include/sys/poll.h (which is the actual header file reached via poll.h) contains:

typedef unsigned long int nfds_t;

and it wins, because the typedef in lha_internal.h is conditional.

@dmuhamedagic
Copy link
Collaborator

dmuhamedagic commented Jan 2, 2017 via email

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

No branches or pull requests

3 participants