GCC thinks I have
sql_LV.c:543:35: error: request for member ‘str’ in something not a structure or union
&(((**functions).String[i]).str)
GDB is thinks differently:
(gdb) print &(((**functions).String[0]).str)
$1 = (uChar (*)[1]) 0xf550514c
(gdb) print (((**functions).String[0]).str)
$2 = "N"
And here's the code:
typedef struct {
int32 cnt; /* number of bytes that follow */
uChar str[1]; /* cnt bytes */
} LStr, *LStrPtr, **LStrHandle;
typedef struct {
int32 dimSize;
LStrHandle String[1];
} LStrArry;
typedef LStrArry **LStrArryHdl;
char IsFunction(LStrArryHdl functions, char* InStr, int32 InStrLen) {
if (functions == NULL) return 0;
for (int i = 0; i< (**functions).dimSize; i++) {
if (strncmp(InStr,
&(((**functions).String[i]).str),
(InStrLen < ((**functions).String[i].cnt) ? InStrLen : ((**functions).String[i].cnt))
) == 0) return 1;
}
return 0;
}
So what's the discrepancy? I've included the typedefs.