In a function with a single va_list arg, I'm trying to attribute a list of variables as per an externally defined (header file) struct wifi_ap_record_t (other values omitted for clarity).
The type definition in "wifi_ap_record_t_header_location.h" is as follows, this is an external library I'm unable to edit:
typedef struct {
uint8_t ssid[33]; /**< SSID of AP */
} wifi_ap_record_t;
On compilation I'm getting the following error:
error: dereferencing pointer to incomplete type 'const struct wifi_ap_record_t'
which is upset about the p->ssid
pointer. I've tried redefining the typedef with and without the pointer as well as defining a blank wifi_ap_record
variable of type wifi_ap_record_t
.
Code as below, what is missing here?
#include "wifi_ap_record_t_header_location.h"
typedef struct wifi_ap_record_t* wifi_ap_record;
void function(va_list *ap) {
const struct wifi_ap_record_t *p = va_arg(*ap, const struct wifi_ap_record *);
printf("ssid: %s", p->ssid;
}