Skip to content

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