   Strange warnings about reverse_iterator
  Hi. I get 4 warning for this function:void SetFileDir(unsigned int dir){FileDir *fileDir;std::vector<std::string> temp;if (dir > 0 && dir < dirCount){fileDir = &fileDirs[dir];for (;;){unsigned int parent = fileDir->parent;temp.push_back(fileDir->string);if (parent == 0)break;elsefileDir = &fileDirs[parent];}if (!temp.empty()){int dirs = temp.size();SetFileDir(temp[--dirs]);while (dirs > 0)AddFileDir(temp[--dirs]);}}elseSetFileDir("");}The warnings I get:--------------------Configuration: BaseCodeCppTest - Win32 Debug--------------------Compiling...filepath.cppC:\Save\Projects\Programming\Base Code\Cpp\filepath.cpp(83) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug informationC:\Save\Projects\Programming\Base Code\Cpp\filepath.cpp(83) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters in the debug informationc:\program\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug informationc:\program\microsoft visual studio\vc98\include\vector(60) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug informationLinking...BaseCodeCppTest.exe - 0 error(s), 4 warning(s)The first 2 warnings points to the end of the function(the end bracket).The last 2 ones points within the vector class:Warning 3 at:explicit vector(const _A& _Al = _A()): allocator(_Al), _First(0), _Last(0), _End(0) {}Warning 4 at:~vector(){_Destroy(_First, _Last);allocator.deallocate(_First, _End - _First);/* Here -> */   _First = 0, _Last = 0, _End = 0; }Why about reverse_iterator?What do I do about them? How do I get rid of them in debug build?It doesn't matter if I declare the temp vector to string or pointer to string.I only need that temp vector for that function.The whole code for that file: (If needed)#include "stdafx.h"#include "filepath.h"#include "printlog.h"#include <fstream>#include <string>#include <vector>std::string dataDir;std::string &GetDataDir(){logSection << "GetDataDir()";LogSectionStart();std::ifstream ifs;ifs.open("Data.dir");if (ifs.good()){ifs >> dataDir;printLog << "Could get it from: \"Data.dir\"." << std::endl;}else{dataDir = "";printLog << "Couldn't get it from: \"Data.dir\"." << std::endl;}printLog << "Data directory: \"" << dataDir << '"' << std::endl;LogSectionEnd();return dataDir;}FileDir *fileDirs;unsigned int dirCount;void SetFileDirs(FileDir *dirs, unsigned int count){fileDirs = dirs;dirCount = count;}void SetFileDir(unsigned int dir){FileDir *fileDir;std::vector<std::string> temp;if (dir > 0 && dir < dirCount){fileDir = &fileDirs[dir];for (;;){unsigned int parent = fileDir->parent;temp.push_back(fileDir->string);if (parent == 0)break;elsefileDir = &fileDirs[parent];}if (!temp.empty()){int dirs = temp.size();SetFileDir(temp[--dirs]);while (dirs > 0)AddFileDir(temp[--dirs]);}}elseSetFileDir("");}std::string dirPath;std::string filePath;void EnsureSlash(){if (!dirPath.empty()){int lastIndex = dirPath.length() - 1;switch (dirPath[lastIndex]){case '/':// Exists, ok.return;case '\\':// Replace.dirPath[lastIndex] = '/';return;default:// Missing, add, gets extended.dirPath += '/';return;}}}void SetFileDir(const std::string &dir){dirPath = dir;if (!dirPath.empty())EnsureSlash();}std::vector<unsigned int> addDirsLength;void AddFileDir(const std::string &dir){logSection << "AddFileDir(\"" << dir << "\")";LogSectionStart();if (!dir.empty()){printLog << "Previous dirpath: " << dirPath << std::endl;unsigned int preDirLength = dirPath.length();printLog << "Directory path length: " << preDirLength << std::endl;addDirsLength.push_back(preDirLength);dirPath += dir;EnsureSlash();printLog << "Resulting dirpath: " << dirPath << std::endl;}elseprintLog << "Just an empty dir string" << std::endl;LogSectionEnd();}void SubLastDir(){logSection << "SubLastDir()";LogSectionStart();int dirs = addDirsLength.size();if (dirs > 0){printLog << "Previous file directory path: " << dirPath << std::endl;unsigned int subDirLength = addDirsLength[dirs-1];printLog << "Subtraction length: " << subDirLength << std::endl;dirPath = dirPath.substr(0,subDirLength);addDirsLength.pop_back();printLog << "Resulting file directory path: " << dirPath << std::endl;}elseprintLog << "No added file dirs to subtract." << std::endl;LogSectionEnd();}std::string &FilePath(const std::string &filename){logSection << "FilePath(\"" << filename << "\")";LogSectionStart();printLog << "Current file directory path: " << dirPath << std::endl;printLog << "Filename: " << filename << std::endl;filePath = dirPath + filename;printLog << "Resulting file path: " << filePath << std::endl;LogSectionEnd();return filePath;}
  By any chance are you using a really old version of MSVC?   ;Quote:Original post by SiCraneBy any chance are you using a really old version of MSVC?Yes I am. Version 6.0 (Yes I know)Do these warnings disappear on the new(er) IDE:s?But why do I get these warnings? Is it something wrong about the way I'm getting the added vector string's reversely.   ;  You are getting these warnings because MSVC 6 has poor support for template code. They'll disappear if you upgrade.   ;Quote:Original post by SiCraneYou are getting these warnings because MSVC 6 has poor support for template code. They'll disappear if you upgrade.Ok. Thanks SiCrane.   