Yo Hal! On Sat, 01 Nov 2025 14:11:55 -0700 Hal Murray <[email protected]> wrote:
> > Care to share the warning? That last one you gave was for gcc 14.
>
> No warnings with gcc 14.
> Warnings with gcc 10 and ncurses installed.
> No warnings with gcc 10 and no ncurses.
Yes, you have been saying that.
> I have no idea what ncurses is doing.
It makes cgps into a terminal app with cursor control. Just
like the old curses, but new.
> gpsd-3.26.2~dev/gpsmon/monitor_nmea0183.c: In function
> \u2018nmea_update\u2019:
> gpsd-3.26.2~dev/gpsmon/monitor_nmea0183.c:313:17: warning: array
> subscript -1 is outside array bounds of \u2018char[132]\u2019
> [-Warray-bounds] 313 | *--s_end = '.';
> | ^~~~~~~~
> gpsd-3.26.2~dev/gpsmon/monitor_nmea0183.c:32:13: note: while
> referencing \u2018sentences\u2019
> 32 | static char sentences[132];
> | ^~~~~~~~~
> [plus 2 more]
Similar to the gcc 14 that is fixed. Gcc thinks the array can be
underwritten. But I just showed you haw that can not happen. Do
you understand and agree with my explanation?
I suspect part of the problem is the code is written as pointers, but
the warnings are written as arry[index]. Would the code be clerrer to
you, and gcc, if I rewrote it to use indexes?
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
[email protected] Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can't measure it, you can't improve it." - Lord Kelvin
pgppSJUlaiPgN.pgp
Description: OpenPGP digital signature
