Opened 4 years ago

Closed 4 years ago

#10404 closed Bug report (fixed)

Ubuntu Linux 14.04 Compile bug in misc.cpp

Reported by: John Szetela Owned by:
Priority: normal Component: FileZilla Client
Keywords: Linux Compile Cc:
Component version: Operating system type: Linux
Operating system version: Ubuntu 14.04 Kernel: 3.13.0-51

Description

Filezilla 3.10.3 #6672
GCC 4.8.2
Compile Error:
../../../src/engine/misc.cpp: In function ¿int GetRandomNumber(int, int)¿:
../../../src/engine/misc.cpp:276:34: error: no match for call to ¿(std::uniform_int_distribution<int>) (std::random_device)¿

return dist(std::random_device());

Patch: src/engine/misc.cpp
int GetRandomNumber(int min, int max)
{

wxASSERT(min <= max);
if (min >= max)

return min;

/* JJS Commented out May 3, 2015

std::uniform_int_distribution<int> dist(min, max);
return dist(std::random_device());

*/

/* JJS Added these two lines right from the GCC random documentation... */

std::random_device rd;
std::mt19937 gen(rd());

std::uniform_int_distribution<int> dist(min, max);
return dist(gen);

}

I would submit a patch, but I suspect the "real" fix is much simpler. I've been away from GCC for a while...

Change History (1)

comment:1 Changed 4 years ago by Tim Kosse

Resolution: fixed
Status: newclosed

Thanks. A fix has already been committed.

Note: See TracTickets for help on using tickets.