const struct

1
2
3
4
5
6
typedef const struct {
    enum log_entry_subtype subtype;
    int reqlen;
    uint16_t eflags;
    char *format;
} entry_details;

The const qualifier there is nonsense, and may even cause a compilation error with some C compilers. gcc issues a warning. The const qualifier applies to variables or members.

以上代码是在 memcached 源码的 logger.h