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

Fix warnings for functions and blocks with no parameters #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adimango
Copy link

The SDK has several warnings linked to the declaration of fuction and block with no parameters.

This error occurs when you try to declare a function with no arguments, and compile with -Werror=strict-prototypes, as follows:

int foo();

Fix it by declare it as

int foo(void);

This is because in c, foo(void) takes no arguments while foo() takes a infinite number of arguments.

The same, when declaring blocks with no parameters:

Fixed it by declaring it as

void (^)(void)

@adimango adimango changed the title Fixed warnings for functions and blocks with no parameters Fix warnings for functions and blocks with no parameters Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant