Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Haster <geky@geky.net>2023-04-26 10:41:30 +0300
committerGitHub <noreply@github.com>2023-04-26 10:41:30 +0300
commit50b394ca36c54f657b92ce9d9ee97f45d811a81d (patch)
tree86056999729d56302eaf53ce0ee49756b425a3bf
parenta99574cd5b4502bdece75a1692838c1a21d72655 (diff)
parentaae897ffd08dae7869445214e67e0f3d4f4d18f4 (diff)
Merge pull request #801 from littlefs-project/assert-bool-cast
Add an assert for truthy-preserving bool conversions
-rw-r--r--lfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lfs.c b/lfs.c
index c925984..7dae2f4 100644
--- a/lfs.c
+++ b/lfs.c
@@ -4022,6 +4022,12 @@ static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) {
lfs->cfg = cfg;
int err = 0;
+ // check that bool is a truthy-preserving type
+ //
+ // note the most common reason for this failure is a before-c99 compiler,
+ // which littlefs currently does not support
+ LFS_ASSERT((bool)0x80000000);
+
// validate that the lfs-cfg sizes were initiated properly before
// performing any arithmetic logics with them
LFS_ASSERT(lfs->cfg->read_size != 0);