intel / cryptography-primitives

Apache License 2.0
318 stars 86 forks source link

Compilation warnings and error in Release mode #73

Open hector-cao opened 7 months ago

hector-cao commented 7 months ago

When I enable -Wall and build ipp-crypto in Release mode, there are a bunch of build warnings and warnings are treated as errors that make my compilation failed.

$ gcc --version gcc (Ubuntu 13.2.0-13ubuntu1) 13.2.0 Copyright (C) 2023 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.

Here is the cmake command:

cmake ./ -DARCH=intel64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-Wall "

To remove all warnings, i need to add following flags:

                             -Wno-unused-function -Wno-unused-variable \                                                         
                             -Wno-unused-but-set-variable \                                                                      
                             -Wno-pedantic -Wno-comment \                                                                        
                             -Wno-array-parameter -Wno-strict-aliasing \                                                         
                             -Wno-parentheses -Wno-unknown-pragmas \                                                             
                             -Wno-missing-braces

I m wondering if some of those warnings can be easily fixed ?

paveldyakov commented 7 months ago

Hi @hector-cao,

Thank you for reporting the issue! I was able to reproduce the mentioned behavior.

Could you please tell if -Wall flag is important for your application? Mentioned warnings are not critical and should not affect the functionality correctness.

hector-cao commented 7 months ago

Hello @paveldyakov , thanks for your feedback,

-Wall is not essential, but i think this is a good opportunity to fix some of warnings, especially for the ones that are trivial and obvious.

paveldyakov commented 7 months ago

@hector-cao, Glad to hear that it doesn't block you. And I definitely agree with you - we will add "-Wall" enabling in our future plans