1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-24 14:20:59 +03:00

MCOL-537 There are no CS-specific warnings building with gcc 8.2.

This commit is contained in:
Roman Nozdrin
2019-04-29 12:26:12 +03:00
parent 9dc33c4e82
commit 7e2cb05624
23 changed files with 94 additions and 334 deletions

View File

@@ -830,10 +830,11 @@ void printInputSource(
if (alternateImportDir == IMPORT_PATH_CWD)
{
char cwdBuf[4096];
::getcwd(cwdBuf, sizeof(cwdBuf));
char *bufPtr = &cwdBuf[0];
bufPtr = ::getcwd(cwdBuf, sizeof(cwdBuf));
if (!(BulkLoad::disableConsoleOutput()))
cout << "Input file(s) will be read from : " << cwdBuf << endl;
cout << "Input file(s) will be read from : " << bufPtr << endl;
}
else
{
@@ -1021,7 +1022,9 @@ int main(int argc, char** argv)
#ifdef _MSC_VER
_setmaxstdio(2048);
#else
#pragma GCC diagnostic ignored "-Wunused-result"
setuid( 0 ); // set effective ID to root; ignore return status
#pragma GCC diagnostic pop
#endif
setupSignalHandlers();

View File

@@ -1462,9 +1462,11 @@ void TableInfo::writeBadRows( const std::vector<std::string>* errorDatRows,
if (!p.has_root_path())
{
// We could fail here having fixed size buffer
char cwdPath[4096];
getcwd(cwdPath, sizeof(cwdPath));
boost::filesystem::path rejectFileName2( cwdPath );
char* buffPtr = &cwdPath[0];
buffPtr = getcwd(cwdPath, sizeof(cwdPath));
boost::filesystem::path rejectFileName2( buffPtr );
rejectFileName2 /= fRejectDataFileName;
fBadFiles.push_back( rejectFileName2.string() );
@@ -1569,8 +1571,9 @@ void TableInfo::writeErrReason( const std::vector< std::pair<RID,
if (!p.has_root_path())
{
char cwdPath[4096];
getcwd(cwdPath, sizeof(cwdPath));
boost::filesystem::path errFileName2( cwdPath );
char* buffPtr = &cwdPath[0];
buffPtr = getcwd(cwdPath, sizeof(cwdPath));
boost::filesystem::path errFileName2( buffPtr );
errFileName2 /= fRejectErrFileName;
fErrFiles.push_back( errFileName2.string() );

View File

@@ -269,8 +269,8 @@ int WE_GetFileSizes::processFileName(
std::string& errMsg, int key)
{
uint8_t rc = 0;
off_t fileSize;
off_t compressedFileSize;
off_t fileSize = 0;
off_t compressedFileSize = 0;
errMsg.clear();
try

View File

@@ -1923,10 +1923,14 @@ int ChunkManager::reallocateChunks(CompFileData* fileData)
struct tm ltm;
localtime_r(reinterpret_cast<time_t*>(&tv.tv_sec), &ltm);
char tmText[24];
// this snprintf call causes a compiler warning b/c buffer size is less
// then maximum string size.
#pragma GCC diagnostic ignored "-Wformat-truncation="
snprintf(tmText, sizeof(tmText), ".%04d%02d%02d%02d%02d%02d%06ld",
ltm.tm_year + 1900, ltm.tm_mon + 1,
ltm.tm_mday, ltm.tm_hour, ltm.tm_min,
ltm.tm_sec, tv.tv_usec);
#pragma GCC diagnostic pop
string dbgFileName(rlcFileName + tmText);
ostringstream oss;
@@ -2106,10 +2110,14 @@ int ChunkManager::reallocateChunks(CompFileData* fileData)
struct tm ltm;
localtime_r(reinterpret_cast<time_t*>(&tv.tv_sec), &ltm);
char tmText[24];
// this snprintf call causes a compiler warning b/c buffer size is less
// then maximum string size.
#pragma GCC diagnostic ignored "-Wformat-truncation="
snprintf(tmText, sizeof(tmText), ".%04d%02d%02d%02d%02d%02d%06ld",
ltm.tm_year + 1900, ltm.tm_mon + 1,
ltm.tm_mday, ltm.tm_hour, ltm.tm_min,
ltm.tm_sec, tv.tv_usec);
#pragma GCC diagnostic pop
string dbgFileName(rlcFileName + tmText);
ostringstream oss;

View File

@@ -604,7 +604,10 @@ void WESplitterApp::updateWithJobFile(int aIdx)
int main(int argc, char** argv)
{
std::string err;
#pragma GCC diagnostic ignored "-Wunused-result"
// Why do we need this if we don't care about f()'s rc ?
setuid(0); //@BUG 4343 set effective userid to root.
#pragma GCC diagnostic pop
std::cin.sync_with_stdio(false);
try

View File

@@ -38,9 +38,9 @@ namespace
{
const char* DICT_TYPE("D");
const char* ENCODING("UTF-8");
const char* JOBNAME("Job_");
const char* LOGNAME("Jobxml_");
const std::string LOGDIR("/log/");
const char* JOBNAME("Job_");
}
namespace WriteEngine
@@ -438,13 +438,11 @@ void XMLGenProc::getColumnsForTable(
throw std::runtime_error( oss.str() );
}
}
//------------------------------------------------------------------------------
// Generate Job XML File Name
//------------------------------------------------------------------------------
// This isn't used currently, commenting it out
#if 0
std::string XMLGenProc::genJobXMLFileName( ) const
{
std::string xmlFileName;
@@ -471,7 +469,7 @@ std::string XMLGenProc::genJobXMLFileName( ) const
char *buf;
buf = getcwd(cwdPath, sizeof(cwdPath));
if (buf == NULL)
throw runtime_error("Failed to get the current working directory!");
throw std::runtime_error("Failed to get the current working directory!");
boost::filesystem::path p2(cwdPath);
p2 /= p;
xmlFileName = p2.string();
@@ -485,9 +483,7 @@ std::string XMLGenProc::genJobXMLFileName( ) const
return xmlFileName;
}
#endif
//------------------------------------------------------------------------------
// writeXMLFile
//------------------------------------------------------------------------------

View File

@@ -90,7 +90,7 @@ public:
/** @brief Generate Job XML file name
*/
//EXPORT std::string genJobXMLFileName( ) const;
EXPORT std::string genJobXMLFileName( ) const;
/** @brief Write xml file document to the destination Job XML file.
*