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

teddy: always initialize variable #313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on May 17, 2021

  1. teddy: always initialize variable

    Hyperscan fails to build with Clang when the "sometimes-unitialized"
    check is switched on:
    
    src/fdr/teddy_runtime_common.h:359:13: error: variable 'val' is used
    uninitialized whenever 'if' condition is false
    [-Werror,-Wsometimes-uninitialized]
            if (avail >= 64) {
                ^~~~~~~~~~~
    src/fdr/teddy_runtime_common.h:388:27: note: uninitialized use occurs
    here
        val = loadu_mask_m512(val, j, ptr);
                              ^~~
    src/fdr/teddy_runtime_common.h:359:9: note: remove the 'if' if its
    condition is always true
            if (avail >= 64) {
            ^~~~~~~~~~~~~~~~~
    src/fdr/teddy_runtime_common.h:351:5: note: variable 'val' is declared
    here
        m512 val;
        ^
    
    Always initialize 'val' to zero upon declaration.
    
    Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@intel.com>
    rojkov committed May 17, 2021
    Configuration menu
    Copy the full SHA
    8d1173a View commit details
    Browse the repository at this point in the history