I noticed that DPDK include files have a number of anonymous/unnamed struct:

For example:

/**
 * The rte_spinlock_t type.
 */
typedef struct {
        volatile int locked; /**< lock status 0 = unlocked, 1 = locked */
} rte_spinlock_t;

This choice doesn't allow to use forward declaration. I need forward
declaration because I'm using a rte_spinlock_t pointer in a C++ class
and I don't want to include rte_spinlock.h to prevent my application
to include it as well.

Is there any reason to use unnamed structures?

Thx

Reply via email to