You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
warnings: clear all -Wpointer-sign / -Wunused-value / -Wunused-variable
A clean rebuild surfaced four warning categories that pre-dated the
audit loop. Walking each:
- Source/Misra/Sys/Proc.c -- POSIX shim macros (close, dup2, read,
write, ...) carried an outer cast '((int)misra_proc_close(fd))'.
In statement position 'close(fd);' the cast result is computed and
discarded -> -Wunused-value at every callsite. Drop the outer cast;
implicit conversion handles the (long -> int/pid_t) at assignment
sites that bind the result.
- Include/Misra/Types.h -- add a portable UNUSED(x) macro -> '(void)(x)'.
Pure C, no compiler dispatch needed, works on MSVC. Used for the
next item.
- Include/Misra/Std/Allocator.h -- Scope / ScopeWith macros declare
MisraScope as a per-iteration for-loop variable that the body MAY
not reference (legitimate -- not every Scope user needs the default
allocator). GCC -Wunused-variable fired. Read MisraScope through
UNUSED() in the loop condition to mark it 'used'.
- Include/Misra/Std/Allocator/Budget.h -- the BudgetAllocatorInit
designated-initializer chain wrapped the MemSet call as
'(MemSet(...), 0)'. The trailing ', 0' was discarded by the outer
comma chain -> -Wunused-value. MemSet returns void, which the
comma operator accepts in a non-last position; drop the ', 0'.
- Source/Misra/Std/Container/Map.c -- after GenericMap.entries went
from char * to u8 * in commit 1c5a458, several internal scratch
vars (old_entries, new_entries, temp_entry) and the
map_copy_into_entry parameter were still typed char *, producing
-Wpointer-sign at every read / assignment. Flip them all to u8 *
to match the field type.
Drops .audit-questions.md item 1 (the Debug.c cascading warnings,
which a fresh build confirms are already resolved -- the macro
expansion is now well-formed '&((void *[]){(ptr)})[0]' from the
commit 88950a9 Map LVAL_AS refactor).
0 commit comments