This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

at_cmd.h unknown type size_t

Hi,

I get an error saying that  size_t is an unknown type name when I include at_cmd.h. I checked the source and at_cmd.h include zephyr/types.h, which includes stdint.h but none of these contain the definition for size_t. I believe this is a bug. I can workaround by including a header containing size_t (eg. zephyr.h or stddef.h) before including at_cmd.h

Example: Including at_cmd.h before zephyr.h gives an error.

#include <at_cmd.h>
#include <zephyr.h>

Including at_cmd.h after zephyr.h works.

#include <zephyr.h>
#include <at_cmd.h>

It can also be fixed by just adding #include <stddef.h> to the at_cmd.h header.

This is a problem for me because my code formatter sorts my includes in alphabetical order. So code that was otherwise working will break after formatting.

Related