[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

infinite recursion in cpp with -O and -traditional in <string.h>

reassign 57294 libc6-dev
reassign 57542 libc6-dev

--- Begin Message ---
> Regarding #54951, I think we need upstream's comments on whether or
> not the __extension__ keyword should silence this particular
> warning, glibc upstream thinks it should.

I think it should, and it appears to be fixed in the mainline. Without
any deeper analysis, I'd say the patch

Wed Sep 22 06:25:15 1999  Jim Kingdon  <http://developer.redhat.com>

	* c-parse.in: save and restore warn_pointer_arith on __extension__
	along with pedantic.
	Set the type of extension to itype rather than $<itype>1 kludge.
	* extend.texi (Alternate Keywords): Adjust documentation.
	* c-parse.c, c-parse.y, objc-parse.c, objc-parse.y: Rebuilt.

fixed it.

> I have no clue on #57294.

It seems to be caused by a recursive definition of the strpbrk macro.
It roughly looks like

# define strpbrk(s, accept) 
  ({ char __a0, __a1, __a2;
     <condition> ? <expression>
     : strpbrk (s, accept); })

Under ANSI rules, strpbrk is not expanded recursively, under K&R
rules, it is.


--- End Message ---

Reply to: