Eclipse无法使用__attribute __((packed))

时间:2018-10-10 06:26:31

标签: eclipse struct typedef packed

我将 typedef 用于我的结构。这些结构需要包装。我使用以下代码定义我的结构:

typedef struct gsp_disk_info {
    uint32_t NumberOfFreeClusters;   // NumberOfFreeClusters
    uint32_t SectorsPerCluster;      // SectorsPerCluster
    uint32_t BytesPerSector;         // BytesPerSector
    uint32_t TotalNumberOfClusters;  // TotalNumberOfClusters 
}__attribute__((packed)) GSP_DISK_INFO;

Eclipse在最后一个括号后要使用分号。因此,变量字段无法解析。真烦人如果我删除属性((已打包)),则一切正常。

此项目正在编译,没有错误。所以我想这个问题在Eclipse设置中。

您能帮忙找出解决方案吗?

0 个答案:

没有答案