C99 says that strncmp has UB for either string being NULL, so the
current behavior is technically correct, but it's an easy fix to handle
this case correctly.
7.1.4: "unless explicitly stated otherwise in the detailed
description... if an argument to a function has ...null pointer.. the
behavior is undefined".
7.21.1: "Unless explicitly stated otherwise in the description of a
particular function in this subclause, pointer arguments on such a call
shall still have valid values, as described in 7.1.4".
Also make the same change for the minimal version in bare-arm/lib.c.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit simplifies and cleans up the bare-arm port, and adds just
enough system and library code to make it execute on an STM32F405 MCU.
The mpconfigport.h configuration is simplified to just specify those
configuration values that are different from the defaults. And the
addition of -fdata-sections and -ffunction-sections means the final
firmware is smaller than it previously was, by about 4200 bytes.
A README is also added.
Signed-off-by: Damien George <damien@micropython.org>