Skip to content

Compilation warnings #19

@Bktero

Description

@Bktero

Hello,

When I clone the repository and simply type 'make' in my terminal, I get a lot of scary warnings:

g++ -ansi -Wall -O3 -c distrib.cpp
In file included from distrib.h:4:0,
                 from distrib.cpp:2:
params.h:24:1: warning: this decimal constant is unsigned only in ISO C90
 const ZmodQ v_inverse = 3758096385; // 1/v mod Q
 ^~~~~
In file included from distrib.h:4:0,
                 from distrib.cpp:2:
params.h:17:36: warning: left shift count >= width of type [-Wshift-count-overflow]
 const long int Q = (long int) 1 << 32;
                                    ^~
g++ -ansi -Wall -O3 -c FFT.cpp
In file included from FFT.h:4:0,
                 from FFT.cpp:3:
params.h:24:1: warning: this decimal constant is unsigned only in ISO C90
 const ZmodQ v_inverse = 3758096385; // 1/v mod Q
 ^~~~~
params.h:17:36: warning: left shift count >= width of type [-Wshift-count-overflow]
 const long int Q = (long int) 1 << 32;
                                    ^~
g++ -ansi -Wall -O3 -c LWE.cpp
In file included from LWE.h:4:0,
                 from LWE.cpp:3:
params.h:24:1: warning: this decimal constant is unsigned only in ISO C90
 const ZmodQ v_inverse = 3758096385; // 1/v mod Q
 ^~~~~
params.h:17:36: warning: left shift count >= width of type [-Wshift-count-overflow]
 const long int Q = (long int) 1 << 32;
                                    ^~
g++ -ansi -Wall -O3 -c FHEW.cpp
In file included from FHEW.h:4:0,
                 from FHEW.cpp:3:
params.h:24:1: warning: this decimal constant is unsigned only in ISO C90
 const ZmodQ v_inverse = 3758096385; // 1/v mod Q
 ^~~~~
params.h:17:36: warning: left shift count >= width of type [-Wshift-count-overflow]
 const long int Q = (long int) 1 << 32;
                                    ^~
ar -q libfhew.a distrib.o FFT.o LWE.o FHEW.o
ar: creating libfhew.a
g++ -ansi -Wall -O3 -c cmd/common.cpp 
In file included from cmd/../LWE.h:4:0,
                 from cmd/common.cpp:3:
cmd/../params.h:24:1: warning: this decimal constant is unsigned only in ISO C90
 const ZmodQ v_inverse = 3758096385; // 1/v mod Q
 ^~~~~
cmd/../params.h:17:36: warning: left shift count >= width of type [-Wshift-count-overflow]
 const long int Q = (long int) 1 << 32;
                                    ^~
g++ -ansi -Wall -O3 -o cmd/gen cmd/gen.cpp common.o -L. -lfhew -lfftw3 
In file included from cmd/../LWE.h:4:0,
                 from cmd/gen.cpp:3:
cmd/../params.h:24:1: warning: this decimal constant is unsigned only in ISO C90
 const ZmodQ v_inverse = 3758096385; // 1/v mod Q
 ^~~~~
cmd/../params.h:17:36: warning: left shift count >= width of type [-Wshift-count-overflow]
 const long int Q = (long int) 1 << 32;
                                    ^~
g++ -ansi -Wall -O3 -o cmd/enc cmd/enc.cpp common.o -L. -lfhew -lfftw3 
In file included from cmd/../LWE.h:4:0,
                 from cmd/enc.cpp:3:
cmd/../params.h:24:1: warning: this decimal constant is unsigned only in ISO C90
 const ZmodQ v_inverse = 3758096385; // 1/v mod Q
 ^~~~~
cmd/../params.h:17:36: warning: left shift count >= width of type [-Wshift-count-overflow]
 const long int Q = (long int) 1 << 32;
                                    ^~
g++ -ansi -Wall -O3 -o cmd/nand cmd/nand.cpp common.o -L. -lfhew -lfftw3 
In file included from cmd/../FHEW.h:4:0,
                 from cmd/nand.cpp:3:
cmd/../params.h:24:1: warning: this decimal constant is unsigned only in ISO C90
 const ZmodQ v_inverse = 3758096385; // 1/v mod Q
 ^~~~~
cmd/../params.h:17:36: warning: left shift count >= width of type [-Wshift-count-overflow]
 const long int Q = (long int) 1 << 32;
                                    ^~
g++ -ansi -Wall -O3 -o cmd/dec cmd/dec.cpp common.o -L. -lfhew -lfftw3 
In file included from cmd/../FHEW.h:4:0,
                 from cmd/dec.cpp:3:
cmd/../params.h:24:1: warning: this decimal constant is unsigned only in ISO C90
 const ZmodQ v_inverse = 3758096385; // 1/v mod Q
 ^~~~~
cmd/../params.h:17:36: warning: left shift count >= width of type [-Wshift-count-overflow]
 const long int Q = (long int) 1 << 32;
                                    ^~
g++ -ansi -Wall -O3 -o cmd/gate cmd/gate.cpp common.o -L. -lfhew -lfftw3 
In file included from cmd/../FHEW.h:4:0,
                 from cmd/gate.cpp:3:
cmd/../params.h:24:1: warning: this decimal constant is unsigned only in ISO C90
 const ZmodQ v_inverse = 3758096385; // 1/v mod Q
 ^~~~~
cmd/../params.h:17:36: warning: left shift count >= width of type [-Wshift-count-overflow]
 const long int Q = (long int) 1 << 32;
                                    ^~
g++ -ansi -Wall -O3 -o fhewTest fhewTest.cpp -L. -lfhew -lfftw3 
In file included from LWE.h:4:0,
                 from fhewTest.cpp:3:
params.h:24:1: warning: this decimal constant is unsigned only in ISO C90
 const ZmodQ v_inverse = 3758096385; // 1/v mod Q
 ^~~~~
params.h:17:36: warning: left shift count >= width of type [-Wshift-count-overflow]
 const long int Q = (long int) 1 << 32;
                                    ^~

Here are some details about my OS & compiler :

    Linux pierre-virtual 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:10 UTC 2018 i686 i686 i686 GNU/Linux
    $ g++ --version
    g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
    Copyright (C) 2017 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Looking at closed issues, these problems have already arose on other platforms, other versions. Seems like it's still here. You should used types like std::uint64_t to enfore the sizes of your integers.

Regards,
Bktero

Metadata

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