Regression in C prototype handling?

Richard Earnshaw rearnsha@arm.com
Mon Feb 14 10:54:00 GMT 2000


> > 
> > Gcc has recently started to reject the following code
> > 
> > 	void foo (int (*cmp)(int *, int *));
> > 
> > 	void foo (int (*cmp)())
> > 	{
> > 	}
> > 
> > Is this intentional (it was accepted by 2.95.2, and probably as recently 
> > as last week).  If so, then it breaks newlib's qsort() which has this type 
> > of declaration/definition combination.
> > 
> 
> Ok, I've dug a bit deeper and it turns out to be an ARM-specific 
> regression.  The problem is that arm_comp_type_attributes returns false if 
> neither of the prototype and the function has any attributes.  This causes 
> the type check comparison to fail.  Looking at arm_comp_type_attributes, I 
> can't follow the intended logic of the comparison, but it is clearly 
> giving the wrong results in this case.
> 
> Richard.
> 
> 


Does the following patch give us the logic that you intended?

<date>  Richard Earnshaw (rearnsha@arm.com)

	* arm.c (arm_comp_type_attributes): Correctly compare attributes for
	conflicts.




More information about the Gcc-bugs mailing list