关于【error: expected identifier before ‘(’ token】错误的检查

版权声明:转载请声明 https://blog.csdn.net/qq_40732350/article/details/82946117

今天编译一个文件时老是出错,把源头定位到一个结构体中是这样

typedef struct GPJ0
{
	volatile unsigned int	GPJ0CON;
	volatile unsigned int	GPJ0DAT;
}gpio_reg_r;

错误就是:

error: expected identifier before '(' token

最后在网上找了一下,发现是GPJ0CON与头文件中的GPJ0CON重名了,但是这重名也太夸张了,连结构体中的变量也会重名

最后改了一下就可以编译了

typedef struct GPJ0
{
	volatile unsigned int	GPJ0con;
	volatile unsigned int	GPJ0dat;
}gpio_reg_r;

猜你喜欢

转载自blog.csdn.net/qq_40732350/article/details/82946117