static queue set

I want to use a statically allocated queue set (yes – I know that there are other equivalent mechanisms). There is no xQueueCreateSetStatic so I have come up with this piece of code: ~~~

if( ( configUSEQUEUESETS == 1 ) && ( configSUPPORTSTATICALLOCATION == 1 ) )

QueueSetHandle_t xQueueCreateSetStatic( const UBaseType_t uxEventQueueLength, uint8_t *pucQueueSetStorage, StaticQueue_t *pxStaticQueueSet )
{
QueueSetHandle_t pxQueue;

    pxQueue = xQueueGenericCreateStatic( uxEventQueueLength, ( UBaseType_t ) sizeof( Queue_t * ), pucQueueSetStorage, pxStaticQueueSet, queueQUEUE_TYPE_SET );

    return pxQueue;
}

endif /* configUSEQUEUESETS */

~~~ Questions: 1. Is there a better/clearer way to implement this functionality? 2. When using this function I have to pass a pointer to a buffer that will hold the queue set elements, internally each element has size sizeof(Queue_t*), which is simply size of a pointer. Is it safe to use static uint8_t queue_set_storage[sizeof(void*)*N]; as the buffer? (GCC, Cortex-M)

static queue set

That looks fine. Your application could of course just call xQueueGeneriCreateStatic() directly, but its not a documented API function so could change in the future – hence the way you are doing is probably best.