The problem is that you are passing a type to your macro, and the macro does not work for types. Because you cannot take the address of a type.
Although you've named the parameter of your macro type
, that name is misleading. The macro accepts variables rather than types. Well, strictly it accepts anything for which you can take the address using the &
operator. Notice that all your other uses of the macro are with variables. Supply a variable of type k_count_t
to your macro and the compiler will be happy.
Of course, the real lesson to learn is to use sizeof
like nature intended.