jlaitine commented on code in PR #8176:
URL: https://github.com/apache/nuttx/pull/8176#discussion_r1073767626
##########
mm/mempool/mempool_multiple.c:
##########
@@ -220,7 +220,7 @@ mempool_multiple_get_dict(FAR struct mempool_multiple_s
*mpool,
col = index - (row << mpool->dict_col_num_log2);
if (mpool->dict[row] == NULL ||
mpool->dict[row][col].addr != addr ||
- blk - addr >= mpool->dict[row][col].size)
+ (FAR char *)blk - (FAR char *)addr >= mpool->dict[row][col].size)
Review Comment:
I am only using gcc, version depending on the target (different versions for
x86, arm linux, arm embedded, SiFive's risc compilers). But the issue here is
just that the compiler flags in NuttX CI doesn't enable warnings for
non-standard gcc extensions. It might be a good idea to go through the default
compiler settings and set warnings on for non-standard extensions (+ maybe use
-Werror in addition).
Strictly standard following flags would be "-ansi -pedantic -Wall". Just to
enable warning on void * arithmetic (which is btw forbidden in standards, but
still has the gcc extension which treats it the same as arithmetic on char *)
can be enabled individually in gcc with -Wpointer-arith
Since I am working on PX4, and they use by default also -Werror (which I
think is a good idea, warnings might go unnoticed otherwise), fixing these is
important...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]