Andrew Pinski wrote: > > On Nov 16, 2004, at 1:30 PM, Dave Hines wrote: > > > Possible bug in gcc-3.4.3 fixincludes on IBM AIX 5.2 > > > > Building the compiler ("make bootstrap") fails when compiling > > genautomata.c, due to a header file problem. The header file which > > produces the error is generated by fixincludes from the system math.h > > file. It appears that the word "class" is triggering the insertion of > > an #ifndef...#endif pair, but the #endif is being tacked on to the end > > of the preceeding line, which ends in a continuation character. > > This was PR 11315 but it is a bug in AIX really. > > Quote from the bug: > > While GCC fixincludes could work around this, it really is an AIX > problem. This has been opened as a defect against AIX 5.2 and will > be fixed by IBM APAR IY46553. It should be avaliable from IBM > Customer Support website in a few weeks (I'll add the PTF number > when I find out) and should appear in the next maintenance release.
That has to be a very interesting bug! Here is the fix specification, with a translation below it: > fix = { > hackname = rs6000_double; > files = math.h; > select = '[^a-zA-Z_]class\('; > > c_fix = format; > c_fix_arg = "#ifndef __cplusplus\n%0\n#endif"; > c_fix_arg = '^.*[^a-zA-Z_]class\(.*'; > > test_text = "extern int class();"; > }; The regex library is used to search for a line that matches the pattern `^.*[^a-zA-Z_]class\(.*' [[A line that contains the word "class" before an opening parenthesis that is not the end of a longer token.]] The fixincl program itself then inserts: "#ifndef __cplusplus\n" before the matched text and: "\n#endif" after it. How can the trailing "#endif" get attached to the preceding line? Some weird I/O bug? Oh, well.....Not a lot I can do about it (add a second newline?)....Sorry - Bruce