Luca Dariz, le mar. 28 juin 2022 11:49:26 +0200, a ecrit:
> * user.c: ensure fixed-length messages have the correct size. In
> addition to the single-fields check, this also include padding.
>
> Signed-off-by: Luca Dariz <[email protected]>
Applied, thanks!
> ---
> user.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/user.c b/user.c
> index 9aff07c..9a84fe4 100644
> --- a/user.c
> +++ b/user.c
> @@ -275,7 +275,10 @@ WriteMsgSend(FILE *file, const routine_t *rt)
> char SendSize[24];
>
> if (rt->rtNumRequestVar == 0)
> + {
> sprintf(SendSize, "%d", rt->rtRequestSize);
> + fprintf(file, "\t_Static_assert(sizeof(Request) == %s, \"Request
> expected to be %s bytes\");\n", SendSize, SendSize);
> + }
> else
> strcpy(SendSize, "msgh_size");
>
> @@ -339,8 +342,10 @@ WriteMsgRPC(FILE *file, const routine_t *rt)
> char SendSize[24];
>
> if (rt->rtNumRequestVar == 0)
> + {
> sprintf(SendSize, "%d", rt->rtRequestSize);
> - else
> + fprintf(file, "\t_Static_assert(sizeof(Request) == %s, \"Request
> expected to be %s bytes\");\n", SendSize, SendSize);
> + } else
> strcpy(SendSize, "msgh_size");
>
> if (IsKernelUser)
> --
> 2.30.2
>
>
--
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.