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

Build error (hitagS.c, bitwise comparison) #605

Closed
ikarus23 opened this issue May 10, 2018 · 3 comments
Closed

Build error (hitagS.c, bitwise comparison) #605

ikarus23 opened this issue May 10, 2018 · 3 comments

Comments

@ikarus23
Copy link
Member

ikarus23 commented May 10, 2018

Hi, I get the following build error. I've not been able to look into it yet. Maybe later this week.

arm-none-eabi-gcc -c -I../include -I../common -I. -Wall -Werror -pedantic -std=c99 -Os -DWITH_ISO14443a_StandAlone -DWITH_LF -DWITH_ISO15693 -DWITH_ISO14443a -DWITH_ISO14443b -DWITH_ICLASS -DWITH_LEGICRF -DWITH_HITAG  -DWITH_CRC -DON_DEVICE -DWITH_HFSNOOP -fno-strict-aliasing -ffunction-sections -fdata-sections -DZ_SOLO -DZ_PREFIX -DNO_GZIP -DZLIB_PM3_TUNED -I../zlib -mthumb -mthumb-interwork -o obj/hitagS.o hitagS.c 
hitagS.c: In function 'SimulateHitagSTag':
hitagS.c:988:27: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
  if((tag.pages[1][2]&0x80)==1)
                           ^~
hitagS.c:991:26: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
  if((tag.pages[1][2]&0x2)==1)
                          ^~
hitagS.c:999:27: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
  if((tag.pages[1][1]&0x80)==1)
                           ^~
hitagS.c:1002:27: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
  if((tag.pages[1][1]&0x40)==1)
                           ^~
hitagS.c:1005:27: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
  if((tag.pages[1][1]&0x20)==1)
                           ^~
hitagS.c:1008:27: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
  if((tag.pages[1][1]&0x10)==1)
                           ^~
hitagS.c:1011:26: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
  if((tag.pages[1][1]&0x8)==1)
                          ^~
hitagS.c:1014:26: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
  if((tag.pages[1][1]&0x4)==1)
                          ^~
hitagS.c:1017:26: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
  if((tag.pages[1][1]&0x2)==1)
                          ^~
cc1: all warnings being treated as errors
@iceman1001
Copy link
Member

iceman1001 commented May 10, 2018

Which version of gcc are you running? Is it a new one?

arm-none-eabi-gcc --version

But yes, ( value & 0x2) == 1 can never be true. Either >1, or == 0x2
CoverityScan complained about this one. I fixed it last year apparently.

iceman1001@8bc1741#diff-589b396aa9cc54b383991e0b312a9950

@ikarus23
Copy link
Member Author

arm-none-eabi-gcc (Arch Repository) 8.1.0 (I'm running Arch Linux, so yeah, it should be the latest version.)

pwpiwi added a commit to pwpiwi/proxmark3 that referenced this issue May 10, 2018
@ikarus23
Copy link
Member Author

#606 works like a charm. Thanks @pwpiwi!

@pwpiwi pwpiwi closed this as completed May 11, 2018
florianrock added a commit to florianrock/proxmark3 that referenced this issue Dec 3, 2018
Bugfix for Proxmark#605 - wrong compare for tag.LKP
pwpiwi pushed a commit that referenced this issue Dec 3, 2018
Bugfix for #605 - wrong compare for tag.LKP
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

3 participants