From owner-freebsd-current@FreeBSD.ORG Sun Sep 12 20:16:13 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 11F3216A4CE for ; Sun, 12 Sep 2004 20:16:13 +0000 (GMT) Received: from fed1rmmtao06.cox.net (fed1rmmtao06.cox.net [68.230.241.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0BDC43D1D for ; Sun, 12 Sep 2004 20:16:12 +0000 (GMT) (envelope-from mezz7@cox.net) Received: from mezz.mezzweb.com ([68.103.32.140]) by fed1rmmtao06.cox.net (InterMail vM.6.01.03.02.01 201-2131-111-104-103-20040709) with ESMTP id <20040912201612.OMTG27594.fed1rmmtao06.cox.net@mezz.mezzweb.com> for ; Sun, 12 Sep 2004 16:16:12 -0400 Date: Sun, 12 Sep 2004 15:16:14 -0500 To: freebsd-current@freebsd.org From: "Jeremy Messenger" Content-Type: text/plain; format=flowed; delsp=yes; charset=us-ascii MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: User-Agent: Opera M2/7.54 (Linux, build 751) Subject: What's default value of -ftemplate-depth in GCC 3.4.2? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Sep 2004 20:16:13 -0000 Hello, I am not sure if I am right, but I have a feel that it is possible that GCC has forgotten to make the change in the document. Or, maybe someone change the GCC 3.4.2's default in FreeBSD? Current, in the document said that the default value is 17 but it looks like it's more than 17 to me. http://gcc.gnu.org/onlinedocs/gcc-3.4.1/gcc/C---Dialect-Options.html#C++%20Dialect%20Options ============================================= -ftemplate-depth-n Set the maximum instantiation depth for template classes to n. A limit on the template instantiation depth is needed to detect endless recursions during template class instantiation. ANSI/ISO C++ conforming programs must not rely on a maximum depth greater than 17. ============================================= I am working on the games/wesnoth update to 0.8.4 and it will fail build on FreeBSD 4.x w/ GCC 2.9x. But, it doesn't fail the build on FreeBSD 5.x w/ GCC 3.4.2. The error looks like this: ============================================= In file included from display.hpp:17, from font.hpp:19, from about.cpp:15: /usr/include/g++/stl_iterator.h: In function `void destroy >::frame *>(animated >::frame *, animated >::frame *)': /usr/include/g++/stl_iterator.h:154: template instantiation depth exceeds maximum of 17 /usr/include/g++/stl_iterator.h:154: (use -ftemplate-depth-NN to increase the maximum) /usr/include/g++/stl_iterator.h:154: instantiating `iterator_traits >::frame *>' [...goes on...] ============================================= So, I added the -ftemplate-depth-20 and it was insteresting that it will fail the build on FreeBSD 5.x w/ GCC 3.4.2 now. Changed it to 45 and it successed. So... This is what it makes me think that GCC team might have change something that is undocumented. Althought, I didn't check the changelog lower than 3.4.1. I don't know where the right place for me to check the default value of -ftemplate-depth. The developer of Wesnoth said that his source code doesn't has more than 10 template depth and said that FreeBSD 4.x's compiler has the bug... I am not sure if he is right, since if I put -ftemplate-depth-20 and it will fail on GCC 3.4.2 either. One more thing, how can I count the template depth in any source code? Cheers, Mezz -- mezz7 at cox.net - mezz at FreeBSD.org FreeBSD GNOME Team http://www.FreeBSD.org/gnome/ - gnome at FreeBSD.org