unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: [PATCH] Verify Size of Objcode Headers
Date: Sun, 20 Jun 2010 23:22:35 +0200	[thread overview]
Message-ID: <87iq5dwg9w.fsf@gnu.org> (raw)
In-Reply-To: AANLkTin3t5ss9MnTEKwx2Am18kQ_IsUZpeNtZK5CQTzB@mail.gmail.com

Hi Noah,

Thanks for the patch!

Noah Lavine <noah.b.lavine@gmail.com> 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’.




  parent reply	other threads:[~2010-06-20 21:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-20 19:44 [PATCH] Verify Size of Objcode Headers Noah Lavine
2010-06-20 20:30 ` Andy Wingo
2010-06-20 21:22 ` Ludovic Courtès [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-06-20 23:59 Noah Lavine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iq5dwg9w.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).