Applied, thanks!
Flavio Cruz, le jeu. 18 juil. 2024 22:25:03 +0100, a ecrit:
> I have noticed a problem when compiling rumpkernel with the new
> thread_get_name:
>
> gnumachUser.c: In function 'thread_get_name':
> gnumachUser.c:1791:37: error: comparison of integer expressions of different
> signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
> 1791 | if (mig_unlikely (msgh_size != 36 +
> ((OutP->nameType.msgt_number + 3) & ~3)))
> | ^~
> gnumachUser.c:25:47: note: in definition of macro 'mig_unlikely'
> 25 | #define mig_unlikely(X) __builtin_expect (!! (X), 0)
> | ^
> cc1: all warnings being treated as errors
>
> This ensures that the compiler won't cast ~3 to int since the code will
> be written as:
>
> 1791 | if (mig_unlikely (msgh_size != 36 +
> ((OutP->nameType.msgt_number + 3) & ~3U)))
> ---
> server.c | 4 ++--
> user.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/server.c b/server.c
> index e02e1e7..8da231c 100644
> --- a/server.c
> +++ b/server.c
> @@ -511,7 +511,7 @@ WriteCheckArgSize(FILE *file, const argument_t *arg)
> /* If the base type size of the data field isn`t a multiple of
> complex_alignof,
> we have to round up. */
> if (btype->itTypeSize % complex_alignof != 0)
> - fprintf(file, " + %zd) & ~%zd", complex_alignof - 1, complex_alignof -
> 1);
> + fprintf(file, " + %zd) & ~%zdU", complex_alignof - 1, complex_alignof -
> 1);
>
> if (ptype->itIndefinite) {
> fprintf(file, " : sizeof(%s *)", FetchServerType(btype));
> @@ -1192,7 +1192,7 @@ WriteArgSize(FILE *file, const argument_t *arg)
> * we have to round up.
> */
> if (bsize % complex_alignof != 0)
> - fprintf(file, " + %zd) & ~%zd", complex_alignof - 1, complex_alignof -
> 1);
> + fprintf(file, " + %zd) & ~%zdU", complex_alignof - 1, complex_alignof -
> 1);
>
> if (ptype->itIndefinite) {
> fprintf(file, " : sizeof(%s *)",
> diff --git a/user.c b/user.c
> index d98ab98..48b8c8b 100644
> --- a/user.c
> +++ b/user.c
> @@ -552,7 +552,7 @@ WriteArgSize(FILE *file, const argument_t *arg)
> * we have to round up.
> */
> if (bsize % complex_alignof != 0)
> - fprintf(file, " + %zd) & ~%zd", complex_alignof - 1, complex_alignof -
> 1);
> + fprintf(file, " + %zd) & ~%zdU", complex_alignof - 1, complex_alignof -
> 1);
>
> if (ptype->itIndefinite) {
> fprintf(file, " : sizeof(%s *)",
> @@ -880,7 +880,7 @@ WriteCheckArgSize(FILE *file, const argument_t *arg)
> /* If the base type size of the data field isn`t a multiple of
> complex_alignof,
> we have to round up. */
> if (btype->itTypeSize % complex_alignof != 0)
> - fprintf(file, " + %zd) & ~%zd", complex_alignof - 1, complex_alignof -
> 1);
> + fprintf(file, " + %zd) & ~%zdU", complex_alignof - 1, complex_alignof -
> 1);
>
> if (ptype->itIndefinite)
> fprintf(file, " : sizeof(%s *)", FetchUserType(btype));
> --
> 2.43.0
>
>
--
Samuel
"2 + 2 = 5 pour d'assez grandes valeurs de 2"