‘invalid use of void expression’ 오류는 void 함수에 대한 호출을 변수에 할당하려고 할 때 발생합니다. void 함수가 다른 데이터 유형으로 피연산될 때도 발생합니다.

원본 소스 파일에서 해당 에러가 발생하지 않더라도, Controller Tester 테스트 과정에서 해당 에러가 발생할 수 있습니다.

typedef unsigned int uint8_t;

typedef volatile uint8_t register8_t;

typedef struct PORT_struct
{
    register8_t DIR;   
    ...
} PORT_t;

static static void PORTE_set_port_dir(void)
{
	uint8_t i;
	*((uint8_t *)&(*(PORT_t *) 0x0480) + 0x10 + i) |= 1 << 3;
}

위의 예시는 type punning을 사용하고 있고, 상수를 포인터로 캐스팅하여 메모리 주소에 직접 접근하고 있습니다.
이러한 경우에 가상 메모리 옵션을 사용중일 경우, 변환 시 void *CS_UT_get_host_addr(unsigned int addr, unsigned int size); 함수로 해당 함수의 내용을 감싸게 됩니다.
CS_UT_get_host_addr 함수가 void 형이므로 정수로 피연산될 때 헤당 에러가 발생합니다.

Need more help with this?
Don’t hesitate to contact us here.

Thanks for your feedback.