我可以为复合文字指定节属性吗?

din*_*rie 5 attributes gcc compound-literals

有了 GCC,我可以这样做:

typedef struct {
    char a;
    int n;
} MyStruct;

MyStruct ms __attribute__((section("MySection"))) = {'x', 33};
MyStruct *pms = &ms;
Run Code Online (Sandbox Code Playgroud)

但是,当我按如下方式使用复合文字时,GCC 会发出警告: 'section' 属性不适用于类型 [-Wattributes]

typedef struct {
    char a;
    int n;
} MyStruct;

MyStruct *pms = &(MyStruct __attribute__((section("MySection")))){'x', 33};
Run Code Online (Sandbox Code Playgroud)

有什么办法可以过去吗?谢谢。