delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/05/09/20:15:35

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <427FFD3E.7040905@ateb.com>
Date: Mon, 09 May 2005 20:15:58 -0400
From: Reid Thompson <reid DOT thompson AT ateb DOT com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
MIME-Version: 1.0
To: "William M. (Mike) Miller" <william DOT m DOT miller AT gmail DOT com>
Cc: cygwin AT cygwin DOT com
Subject: Re: Static destructors not running
References: <48781a66050509154660edcc78 AT mail DOT gmail DOT com>
In-Reply-To: <48781a66050509154660edcc78@mail.gmail.com>
X-OriginalArrivalTime: 10 May 2005 00:14:55.0316 (UTC) FILETIME=[4B12A140:01C554F5]
X-IsSubscribed: yes

William M. (Mike) Miller wrote:

>I'm sure this is the result of my having done something stupid
>with the setup application, but suddenly static destructors no
>longer run.  That is, for the following program:
>
>    #include <stdio.h>
>    struct S {
>      S();
>      ~S();
>    } s;
>    S::S() {
>      printf("In ctor.\n");
>    }
>    S::~S() {
>      printf("In dtor.\n");
>    }
>    int main() {
>      printf("In main.\n");
>    }
>
>the output is
>
>    In ctor.
>    In main.
>
>The output "In dtor." is missing.
>
>I have tried to update all the gcc compilers and mingw libraries to
>the latest versions that the setup application allows me, on the
>assumption that somehow I managed to get an old version of a
>library during my last update, but nothing I have done restores the
>static destructor output.  From cygcheck, here are the versions of
>things I think might matter:
>
>    gcc                  3.4.1-1
>    gcc-ada              3.4.1-1
>    gcc-core             3.4.1-1
>    gcc-g++              3.4.1-1
>    gcc-g77              3.4.1-1
>    gcc-java             3.4.1-1
>    gcc-mingw            20040810-1
>    gcc-mingw-ada        20040822-1
>    gcc-mingw-core       20040822-1
>    gcc-mingw-g++        20040822-1
>    gcc-mingw-g77        20040822-1
>    gcc-mingw-java       20040822-1
>    mingw-runtime        3.7-1
>
>Anyone have any idea how I managed to do this to myself and,
>more importantly, how I can undo it?
>
>Thanks!
>
>  
>
#include <iostream>
class S
{
    public:
S::S()
{
    printf("In ctor.\n");
}

S::~S()
{
    printf("In dtor.\n");
}
} ;

int
main()
{
    printf("In main.\n");
    S();
    return(0);
}

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019