<commit_before>#include "Exception.h"

#include <cstddef>
#include <exception>
#include <fstream>
#include <iostream>
#include <iterator>
#include <limits>
#include <memory>
#include <stdexcept>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <vector>

#include "BackTrace.h"


using namespace std;


static bool initialized = false;


namespace ExceptionLib {

	static bool stackEnabled = true;


	void terminate_handler()
	{
#ifdef __GNUC__
		static bool tried_throw = false;

		try {
			if (!tried_throw) {
				tried_throw = true;
				throw;
			}
			cerr << "no active exception" << endl;
		}
		catch (const ExceptionLib::Exception& ex) {
			cerr << "Caught an Exception: what: " << ex.what() << endl;
			string trace = ex.stacktrace();
			cerr << "stacktrace: " << endl << trace << endl;

			const ExceptionBase * eptr = &ex;
			while(eptr->nested()) {
				eptr = eptr->nested();
				cerr << "Nested exception: what: " << eptr->what() << endl;
				trace = eptr->stacktrace();
				cerr << "stacktrace: " << endl << trace << endl;
			}

		}
		catch (const std::exception &ex) {
			cout << "Caught an std::exception. what(): " << ex.what() << endl;
		}
		catch (...) {
			std::cout << "Caught unknown exception" << std::endl;
		}
#else
		cerr << "Caught unhandled exception" << endl;
#endif
	}

	void init(char *argv0)
	{
		::Backtrace::initialize(argv0);
		set_terminate(terminate_handler);
		initialized = true;
	}

	ExceptionBase::ExceptionBase(const ExceptionBase& that)
		: m_raiser(that.m_raiser)
		, m_cloner(that.m_cloner)
		, st(NULL)
		, m_what(that.m_what)
		, m_nested(NULL)
	{
		if (that.m_nested) {<commit_msg>Remocao de warnings no gcc 4.1<commit_after>#include "Exception.h"

#include <cstddef>
#include <exception>
#include <fstream>
#include <iostream>
#include <iterator>
#include <limits>
#include <memory>
#include <stdexcept>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <vector>

#include "BackTrace.h"


using namespace std;


static bool initialized = false;


namespace ExceptionLib {

	static bool stackEnabled = true;


	void terminate_handler()
	{
#ifdef __GNUC__
		static bool tried_throw = false;

		try {
			if (!tried_throw) {
				tried_throw = true;
				throw;
			}
			cerr << "no active exception" << endl;
		}
		catch (const ExceptionLib::Exception& ex) {
			cerr << "Caught an Exception: what: " << ex.what() << endl;
			string trace = ex.stacktrace();
			cerr << "stacktrace: " << endl << trace << endl;

			const ExceptionBase * eptr = &ex;
			while(eptr->nested()) {
				eptr = eptr->nested();
				cerr << "Nested exception: what: " << eptr->what() << endl;
				trace = eptr->stacktrace();
				cerr << "stacktrace: " << endl << trace << endl;
			}

		}
		catch (const std::exception &ex) {
			cout << "Caught an std::exception. what(): " << ex.what() << endl;
		}
		catch (...) {
			std::cout << "Caught unknown exception" << std::endl;
		}
#else
		cerr << "Caught unhandled exception" << endl;
#endif
	}

	void init(char *argv0)
	{
		::Backtrace::initialize(argv0);
		set_terminate(terminate_handler);
		initialized = true;
	}

	ExceptionBase::ExceptionBase(const ExceptionBase& that)
		: BaseExceptionType()
		, m_raiser(that.m_raiser)
		, m_cloner(that.m_cloner)
		, st(NULL)
		, m_what(that.m_what)
		, m_nested(NULL)
	{
		if (that.m_nested) {
{'fraction_non_alphanumeric': 0.16040853109041756, 'fraction_numerical': 0.0018023430459597476, 'mean_word_length': 3.8051948051948052, 'pattern_counts': {'":': 0, '<': 119, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1257012', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1176, 'n_words': 286}