Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux folder owerflow issue #5

Open
mani8785 opened this issue Apr 6, 2020 · 0 comments
Open

Linux folder owerflow issue #5

mani8785 opened this issue Apr 6, 2020 · 0 comments

Comments

@mani8785
Copy link

mani8785 commented Apr 6, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant