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

bundle_wait() is incompatible with -std=c99, -std=c11, -std=c90 #194

Open
hirrolot opened this issue Jun 18, 2019 · 0 comments
Open

bundle_wait() is incompatible with -std=c99, -std=c11, -std=c90 #194

hirrolot opened this issue Jun 18, 2019 · 0 comments

Comments

@hirrolot
Copy link

Code:

#include <libdill.h>
#include <assert.h>

coroutine void empty() {}

int main() {
	int all = bundle();
	assert(all != -1);
	bundle_go(all, empty()); /* #9 */
	assert(hclose(all) != -1);
}

When trying to compile:

gymmasssorla@gymmasssorla-desktop:~$ gcc main.c -std=c99 -ldill -pthread
In file included from main.c:1:0:
main.c: In function ‘main’:
main.c:9:2: error: expected ‘)’ before ‘:’ token
  bundle_go(all, empty()); /* #9 */
  ^
main.c:9:2: error: expected ‘)’ before ‘:’ token
  bundle_go(all, empty()); /* #9 */
  ^
main.c:9:2: error: expected ‘;’ before ‘volatile’
  bundle_go(all, empty()); /* #9 */
  ^
gymmasssorla@gymmasssorla-desktop:~$ gcc main.c -std=c11 -ldill -pthread
In file included from main.c:1:0:
main.c: In function ‘main’:
main.c:9:2: error: expected ‘)’ before ‘:’ token
  bundle_go(all, empty()); /* #9 */
  ^
main.c:9:2: error: expected ‘)’ before ‘:’ token
  bundle_go(all, empty()); /* #9 */
  ^
main.c:9:2: error: expected ‘;’ before ‘volatile’
  bundle_go(all, empty()); /* #9 */
  ^
gymmasssorla@gymmasssorla-desktop:~$ gcc main.c -std=c90 -ldill -pthread
In file included from main.c:1:0:
main.c: In function ‘main’:
main.c:9:2: error: expected ‘)’ before ‘:’ token
  bundle_go(all, empty()); /* #9 */
  ^
main.c:9:2: error: expected ‘)’ before ‘:’ token
  bundle_go(all, empty()); /* #9 */
  ^
main.c:9:2: error: expected ‘;’ before ‘volatile’
  bundle_go(all, empty()); /* #9 */
  ^

But everything works without the --std=X option. Is this a bug in the LibDill's source code?

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

No branches or pull requests

1 participant