Skip to content

Linux folder owerflow issue #5

Open
@mani8785

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions