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

warning: shifting a negative signed value is undefined #85

Open
yurivict opened this issue Apr 20, 2019 · 0 comments
Open

warning: shifting a negative signed value is undefined #85

yurivict opened this issue Apr 20, 2019 · 0 comments

Comments

@yurivict
Copy link

clang-6 prints these warnings that seem important:

/usr/ports/textproc/zxing-cpp/work/zxing-cpp-e0e40dd/cli/src/jpgd.cpp:568:170: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
static const int s_extend_offset[16] = { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
                                                                                                                                                                     ~~~~^
/usr/ports/textproc/zxing-cpp/work/zxing-cpp-e0e40dd/cli/src/jpgd.cpp:568:185: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
static const int s_extend_offset[16] = { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
                                                                                                                                                                                    ~~~~^
/usr/ports/textproc/zxing-cpp/work/zxing-cpp-e0e40dd/cli/src/jpgd.cpp:568:201: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
static const int s_extend_offset[16] = { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
                                                                                                                                                                                                    ~~~~^
/usr/ports/textproc/zxing-cpp/work/zxing-cpp-e0e40dd/cli/src/jpgd.cpp:568:217: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
static const int s_extend_offset[16] = { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
                                                                                                                                                                                                                    ~~~~^
/usr/ports/textproc/zxing-cpp/work/zxing-cpp-e0e40dd/cli/src/jpgd.cpp:568:233: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
static const int s_extend_offset[16] = { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
                                                                                                                                                                                                                                    ~~~~^

FreeBSD

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