SDCC에 문제가 있습니다. 내 코드 (다른 컴파일러에서 이식하려고 시도 중)는 유연한 배열 멤버가있는 구조체를 사용합니다. 그러나, 나는 다음과 같은 코드를 컴파일하려고 : 무엇 제공sdcc가 코드를 승인하지 않습니다.
$ sdcc -mz80 -S --std-c99 test.c
test.c:18: warning 186: invalid use of structure with flexible array member
test.c:18: error 200: field 'entry' has incomplete type
:
/** header of string list */
typedef struct {
int nCount;
int nMemUsed;
int nMemAvail;
} STRLIST_HEADER;
/** string list entry data type */
typedef struct {
int nLen;
char str[];
} STRLIST_ENTRY;
/** string list data type */
typedef struct {
STRLIST_HEADER header;
STRLIST_ENTRY entry[];
} STRLIST; // By the way, this is the line the error refers to.
int main()
{
return 0;
}
SDCC 다음과 같은 오류를 준다? 이 코드는 gcc에서 잘 컴파일됩니다. 사용하고있는 다른 z80 컴파일러는 말할 것도 없습니다.
편집 : 관련된 것으로 보이는 this SDCC bug이 발견되었습니다. 누군가가 그것이 무엇인지 그리고 어떻게 설명 할 수 있습니까?
우수. SDCC 문서는 좋지 않아서 GCC의 성명서를 수락하면 더 혼란스러워했습니다. 고마워요! – thirtythreeforty