From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15788 invoked by alias); 27 Apr 2004 14:16:33 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 15781 invoked from network); 27 Apr 2004 14:16:32 -0000 Received: from unknown (HELO mgr2.xmission.com) (198.60.22.202) by sources.redhat.com with SMTP; 27 Apr 2004 14:16:32 -0000 Received: from [198.60.22.201] (helo=mgr1.xmission.com) by mgr2.xmission.com with esmtp (Exim 3.35 #1) id 1BITNw-0004Kg-02; Tue, 27 Apr 2004 08:16:32 -0600 Received: from [198.60.22.20] (helo=xmission.xmission.com) by mgr1.xmission.com with esmtp (Exim 4.30) id 1BITNv-0003gx-SB; Tue, 27 Apr 2004 08:16:31 -0600 Received: from llewelly by xmission.xmission.com with local (Exim 3.35 #1 (Debian)) id 1BITNv-0007AI-00; Tue, 27 Apr 2004 08:16:31 -0600 To: hartmut.schirmer@arcor.de Cc: gcc-help@gcc.gnu.org References: <27995117.1083053470687.JavaMail.ngmail@webmail05.arcor-online.net> From: llewelly@xmission.com Date: Tue, 27 Apr 2004 14:16:00 -0000 In-Reply-To: <27995117.1083053470687.JavaMail.ngmail@webmail05.arcor-online.net> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Subject: Re: Omit guard on static objects ? Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on mgr1.xmission.com X-Spam-Level: X-Spam-Status: No, hits=0.3 required=8.0 tests=NO_REAL_NAME autolearn=no version=2.63 X-SA-Exim-Mail-From: llewelly@xmission.com X-SA-Exim-Version: 3.1 (built Wed Aug 20 09:38:54 PDT 2003) X-SA-Exim-Scanned: Yes X-SW-Source: 2004-04/txt/msg00359.txt.bz2 hartmut.schirmer@arcor.de writes: > Hi, > > is there any way to omit the automatic construction guard > created in > > int foo() > { > static class A a; > ... > } If you define A so that its constructor and destructor are trivial, the gaurd will not be generated, unless there is an initializer for a. Otherwise, the gaurd will always be present.