作业帮 > 综合 > 作业

ARM中出现static initialisation of '' using address of '' may ca

来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/06/17 02:29:35
ARM中出现static initialisation of '' using address of '' may cause link failure -ropi警告,如何修改
举个简单的例子:void func1(char a){}
typedef struct wx{
void (*func)(char a);
int a;
int b;} WX;
const WX ly={func1,2,0};
编译时会出现ARM中出现static initialisation of 'ly' using address of 'func1' may cause link failure -ropi警告,请问如何修改才能消除这种警告.
ARM中出现static initialisation of '' using address of '' may ca
void func1(char a){}
typedef struct wx{
void (*func)(char a);
int a;
int b;} WX;
const WX ly={func1,2,0};
int main(){
func1('a');
return 0;
}
编译arm-linux-gcc-4.4.3 -Wall -g -o functest functest.c 未出现警告和错误.