I have been working with pjsip for a while now, and in an effort to get it to work for UWP, I have encountered a seemingly fatal flaw in the base C code. I am getting errors 'addrs': unknown size
and 'deprecatedAddrs': unknown size
in the code below.
PJ_DEF(pj_status_t) pj_enum_ip_interface2( const pj_enum_ip_option *opt,
unsigned *p_cnt,
pj_sockaddr ifs[]) {
pj_enum_ip_option opt_;
if (opt)
opt_ = *opt;
else
pj_enum_ip_option_default(&opt_);
if (opt_.af != pj_AF_INET() && opt_.omit_deprecated_ipv6) {
pj_sockaddr addrs[*p_cnt];
pj_sockaddr deprecatedAddrs[*p_cnt];
unsigned deprecatedCount = *p_cnt;
unsigned cnt = 0;
int i;
pj_status_t status;
...
The error comes for the two lines pj_sockaddr addrs[*p_cnt];
and pj_sockaddr deprecatedAddrs[*p_cnt];
. I feel that I understand that this should not work, due to the fact that C cannot have dynamic arrays and needs to preallocate space. However, pjsip is a well-established library used rather often, so my question is: Is there a situation in which this would function at all?