error: void value not ignored as it ought to be

void형 함수를 리턴이 있는것처럼 사용시 발생했다.

#include <stdio.h>

void test() {
    // nothing
}

int main()
{
    int result = test(); /*	error	*/
}

 

집에와서 재현해보니 visual studio, visual studio code에서는 원인을 자세하게 설명해준다.