[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2009-02-02, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> On 2-Feb-09, at 7:02 AM, Elias Pschernig wrote:
> > On Mon, 2009-02-02 at 20:48 +1100, Peter Wang wrote:
> >> The idea is to not expose the definition of struct _al_tagbstring,
> >> which
> >> is an implementation detail.
> >>
> >
> > The problem is that it is dangerous if someone changes the internal
> > structure and forgets to update the size.
>
> That was my concern as well.
Presumably someone who does that will actually run a few example
programs and find them broken (highly likely, at least).
But there are tricks to implement compile time assertions, e.g.
http://www.pixelbeat.org/programming/gcc/static_assert.html
> > That's of course doing a runtime check for something which
> > should be a compile time check, but it's as good as you can do it in
> > C I
> > guess.
>
> You know, I never really understood why "sizeof(something)" is not a
> compile-time constant.
It is.
Peter