For some reason gcc thinks q+3 might be out of bounds below. It isn't, but
adding the strlen(q) >= 3 condition suppresses the warning.
In function ‘sa_snmatch’,
inlined from ‘sa_snmatch’ at /home/srueger/etc/clock/avrdude/gcc-warning/src/serialadapter.c:56:12,
inlined from ‘sa_num_matches_by_ids’ at /home/srueger/etc/clock/avrdude/gcc-warning/src/serialadapter.c:190:48,
inlined from ‘sa_unique_by_ids’ at /home/srueger/etc/clock/avrdude/gcc-warning/src/serialadapter.c:203:61,
inlined from ‘sa_list_specs’ at /home/srueger/etc/clock/avrdude/gcc-warning/src/serialadapter.c:239:8,
inlined from ‘sa_print_specs’ at /home/srueger/etc/clock/avrdude/gcc-warning/src/serialadapter.c:253:19:
/home/srueger/etc/clock/avrdude/gcc-warning/src/serialadapter.c:57:63: warning: array subscript 3 is outside array bounds of ‘char[1]’ [-Warray-bounds=]
57 | return sn && (str_starts(sn, q) || (str_starts(q, "...") && str_ends(sn, q + 3)));
| ^~~~~~~~~~~~~~~~~~~
* CMakeLists.txt: allow disabling Python support
In some cases, even if Swig is found and Python3 is found, it may not
be desirable to build Python support in avrdude, so this commit adds
a FORCE_DISABLE_PYTHON_SUPPORTT option to be able to explicitly
disable the Python support.
To preserve existing behavior, this option defaults to disabled (OFF).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Co-authored-by: Xiaofan Chen <xiaofanc@gmail.com>
When serving a vector bootloader, both -c urclock and now -c dryboot used
to protect two vectors in the vector table, the reset vector and the
dedicated vector to jump to the application.
Only the reset vector needs protecting to avoid the vector bootloader to
be bricked. While overwriting the other vector might turn out not helpful,
it's the same as with many other interventions, so much so that the driver
should not prevent that. Hence, this commit withdraws the protection of
the jmp-to-application vector.