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

EEPROM\EEPROM.ino:404:16: warning: NULL used in arithmetic [-Wpointer-arith] #17

Open
yasuoiwakura opened this issue Jul 1, 2020 · 2 comments

Comments

@yasuoiwakura
Copy link

hi there, treid to compile today using the Arduino IDE but gut this error:

\RFID522-Door-Unlock-master\EEPROM\EEPROM.ino: In function 'boolean checkTwo(byte*, byte*)':
\RFID522-Door-Unlock-master\EEPROM\EEPROM.ino:404:16: warning: NULL used in arithmetic [-Wpointer-arith]
   if ( a[0] != NULL )    // Make sure there is something in the array first

Other useds came aross this problem, too so i guess it not necessarily related to my machine? https://www.himix.lt/arduino/arduino-and-rfid-reader-mfrc522-for-door-unlock/

@omersiar
Copy link
Owner

omersiar commented Jul 1, 2020

You can safely ignore the warning or even delete the lines 404 and 405.

@DanMan32
Copy link

DanMan32 commented Apr 8, 2021

I found this problem too, not with compiling in Arduino IDE as that wasn't an issue but also if you register a card UID that leads with a 0, such as 08D6444, then this cards and all cards entered after it are skipped and claim "you shall not pass!"

Code called "servo_motor.ino included as an example in rfid library that came with Elegoo Most Complete Mega Projects.

I changed "if ( a[0] != NULL )" to "if ( a != NULL ) ". Not sure if it is legitimate to compare an entire array to NULL or if the comparison will ever be true (all bytes being 0) but it works.

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