Lcrypto / Simulated-annealing-lifting-QC-LDPC

Simulated annealing lifting for high girth QC-LDPC include ACE/EMD optimization. Make QC-LDPC from protograph (base matrix)
GNU General Public License v3.0
20 stars 9 forks source link

Linux folder owerflow issue #5

Open mani8785 opened 4 years ago

mani8785 commented 4 years ago

Dear Vasiliy, I tried to run the code on my Linux machine but it seems that there is an overflow warning on the header file named "irregularldpc.h", the function "ll getRand(ll mod) ".

The warnings are as follows: ../irregularldpc.h:74:36: warning: integer overflow in expression [-Woverflow] long long int q = RAND_MAX + 1; ^ ../irregularldpc.h:77:28: warning: integer overflow in expression [-Woverflow] q = (RAND_MAX + 1); ^ ../irregularldpc.h:78:31: warning: integer overflow in expression [-Woverflow] x = x (RAND_MAX + 1) + rand();

Wondering if you could please check if I am doing something stupid or no?

Anyway, I can compile the code with this warning, but when tried to test the example, I got the following error: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)

Best, Hosma