playground/c/void-rv-assign.c

16 lines
302 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include<stdio.h>
void foo() { }
int main() {
void a = foo();
return 0;
}
/*
void-rv-assign.c:4:10: error: variable or field a declared void
void a = foo();
^
void-rv-assign.c:4:14: error: void value not ignored as it ought to be
void a = foo();
^~~
*/