相关疑难解决方法(0)

用于GNU C/C++的Windows下的内存泄漏检测

什么内存泄漏检测工具可用于Windows上的开源C/C++?

c++ windows open-source memory-leaks

9
推荐指数
2
解决办法
9137
查看次数

C++ GCC4.4警告:数组下标在数组边界之上

我最近升级到GCC 4.4(MinGW TDM版本),现在跟随代码产生这些警告:

在成员函数'void Console :: print(const std :: string&)'中:

警告:数组下标在数组边界之上

这是代码:

void Console::print( const std::string& str ) {
        std::string newLine( str );
        if( newLine.size() > MAX_LINE_LENGTH ) {
            sf::Uint32 stringSize = newLine.size();
            for( sf::Uint32 insertPos = MAX_LINE_LENGTH;
                    insertPos < stringSize; insertPos += MAX_LINE_LENGTH ) {
                newLine.insert( insertPos, "\n" );
            }
        }

        StringList tokens;
        boost::split( tokens, newLine, boost::is_any_of("\n") );

        for( StringList::iterator it = tokens.begin();
                it != tokens.end(); ++it ) {
            addLine( *it );
        }
    }
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?


这是优化正在做...

它似乎是这条线导致它:

boost::split( tokens, …
Run Code Online (Sandbox Code Playgroud)

c++ gcc boost tdm-mingw

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×2

boost ×1

gcc ×1

memory-leaks ×1

open-source ×1

tdm-mingw ×1

windows ×1