[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Verify Size of Objcode Headers
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] Verify Size of Objcode Headers |
Date: |
Sun, 20 Jun 2010 23:22:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hi Noah,
Thanks for the patch!
Noah Lavine <address@hidden> writes:
> + scm_t_uint8 dummy[] = { OBJCODE_HEADER(5,5) };
> + VERIFY_OBJCODE_HEADER_SIZE(dummy);
I think that:
verify (sizeof (dummy) == sizeof (struct scm_objcode));
would be enough (see below). Perhaps the ‘SCM_UNUSED’ attribute is
needed here.
> --- a/libguile/objcodes.h
> +++ b/libguile/objcodes.h
> @@ -21,6 +21,8 @@
>
> #include <libguile.h>
>
> +#include <verify.h> /* from Gnulib, in guile/lib */
This is a public header, so it can’t use private Gnulib headers.
> +#define VERIFY_OBJCODE_HEADER_SIZE(header) verify(sizeof(header) \
> + == sizeof(struct
> scm_objcode))
This is a private macro, so it would have to start with ‘SCM_I_’. But
again, we can just avoid it altogether.
Besides, make sure to follow the GNU coding style (info "(standards)
Writing C"), such as leaving a white space before an opening bracket and
after a closing bracket.
Would you like to post an updated patch?
Thanks,
Ludo’.