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

string parsing error with GPS_HardwareSerial_Parsing.ino example #144

Open
tonysunshine opened this issue Feb 25, 2023 · 0 comments
Open

Comments

@tonysunshine
Copy link

  • Arduino board: Adafruit Feather NRF52840 Express(4062) with Adafruit Ultimate GPS Feather Wing(3133)

  • Arduino IDE version (found in Arduino -> About Arduino menu): 2.0.3

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): Example sketch "GPS_HardwareSerial_Parsing" yields the following errors when trying to compile

c:\Users\xxx\Documents\Arduino\libraries\Adafruit_GPS_Library\src\NMEA_build.cpp: In member function 'char* Adafruit_GPS::build(char*, const char*, const char*, char, bool)':
c:\Users\xxx\Documents\Arduino\libraries\Adafruit_GPS_Library\src\NMEA_build.cpp:76:10: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
76 | strncpy(p, thisSource, strlen(thisSource));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\xxx\Documents\Arduino\libraries\Adafruit_GPS_Library\src\NMEA_build.cpp:78:10: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
78 | strncpy(p, thisSentence, strlen(thisSentence));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'char* Adafruit_GPS::parseStr(char*, char*, int)',
inlined from 'char* Adafruit_GPS::parseStr(char*, char*, int)' at c:\Users\xxx\Documents\Arduino\libraries\Adafruit_GPS_Library\src\NMEA_parse.cpp:751:7:
c:\Users\xxx\Documents\Arduino\libraries\Adafruit_GPS_Library\src\NMEA_parse.cpp:766:14: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
766 | strncpy(buff, p, len); // or to the end or max capacity
| ~~~~~~~^~~~~~~~~~~~~~
c:\Users\xxx\Documents\Arduino\libraries\Adafruit_GPS_Library\src\NMEA_parse.cpp: In member function 'char* Adafruit_GPS::parseStr(char*, char*, int)':
c:\Users\xxx\Documents\Arduino\libraries\Adafruit_GPS_Library\src\NMEA_parse.cpp:765:28: note: length computed here
765 | len = min((int)strlen(p), n - 1);
| ~~~~~~^~~

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