[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Static Asserts
From: |
Ludovic Courtès |
Subject: |
Re: Static Asserts |
Date: |
Sun, 20 Jun 2010 15:58:52 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hi,
Noah Lavine <address@hidden> writes:
> I discovered that my previous build failure was not because of a
> Makefile issue but because my modifications had changed the size of
> struct scm_objcode, which broke other parts of the program. I found
> several files where structs are cast from bytes using #define'd
> values, which are most likely the problem.
>
> It wouldn't be too hard to change these headers to work with my code,
> but that wouldn't be very future-proof. I'd like to add some mechanism
> so that if sizeof(struct scm_objcode) ever changes again, it will be
> obvious that there is a problem. It seems to me that the best way to
> do this is some sort of assertion. I'd like to pick an assert
> mechanism that is acceptable to the Guile developers. Therefore, my
> question is this: what sort of compile-time assert mechanism would you
> like to see?
We already use Gnulib’s ‘verify’ macro in some places (see
‘lib/verify.h’). If you stumble upon a missing assertion, please do
post a patch. :-)
Thanks,
Ludo’.
- Static Asserts, Noah Lavine, 2010/06/19
- Re: Static Asserts,
Ludovic Courtès <=