Red Hat Bugzilla – Bug 150169

Infinite include-loop

Last modified: 2007-11-30 17:11:01 EST

Description of problem: When trying to compile my program using fam I get the error message "#include nested too deeply". Version-Release number of selected component (if applicable): 0.0.25-4 How reproducible: 100% Actual results: In file included from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/fam.h:34, from animenu.c:27: /usr/include/limits.h:124:26: error: #include nested too deeply /usr/include/limits.h:144:30: error: #include nested too deeply /usr/include/limits.h:148:30: error: #include nested too deeply In file included from /usr/include/limits.h:144, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/limits.h:124, from /usr/include/fam.h:34, from animenu.c:27: /usr/include/bits/posix1_lim.h:153:28: error: #include nested too deeply Expected results: A clean compilation. Additional info: This worked fine in previous (0.0.24) gamin. Glibc is up to date (2.3.4-10).

Unable to reproduce this, I need code exhibiting this problem. As is the bug is incomplete and cannot be processed. Daniel

Created attachment 111612 [details] Code to reproduce the problem This test code gives the error. I simply compiled it using " gcc -o gamtest -lfam gamtest.cc".

Hmmm... Tried downgrading gamin to 0.0.24, the version that worked yesterday and I get the same result, so it's obviously not a gamin bug after all. Any idea where I should file this bug instead? glibc?

At a closer thought I guess this must be a gcc bug. Reassigning it now...

Just to clarify: I upgraded gcc from 3.x to 4.0 at the same time I upgraded gamin. So this bug wasn't present using 3.x.

Could anyone from the gcc team please comment whether this seems to be a gcc bug? I'm not quite sure for myself... btw, updated to 4.0.0-0.31 today, no difference.

I'd say this is primarily a bug in fam. Using #include "system_header.h" in /usr/include headers is just wrong. You don't know where the right headers are, so forcing the compiler to use /usr/include header is a bug. /usr/include/fam.h should #include <limits.h> instead of #include "limits.h".

Ok, thanks for the answer. I'll re-reassign this bug to Veillard again...

The fam-oss code from SGI had #include "limits.h" in the fam.h include header. So it had been that way "forever", I just tried to minimize the differences between gamin reimplementation that's why I kept a similar include, and well it wasn't breaking at the time. This means that gcc4 will now break compiling a number of legacy code on platforms still using the original FAM. I fixed the include in the upstream CVS, it should fix the problem when I push a new release. Daniel