Front page | perl.perl5.porters |
Postings from June 2010
Re: ANSI requirement
Thread Previous
|
Thread Next
From:
Aaron Crane
Date:
June 13, 2010 10:10
Subject:
Re: ANSI requirement
Message ID:
AANLkTimLkMObd-BTXP1Hasj1JNlZPBybKM2N80BHgat0@mail.gmail.com
Zefram <zefram@fysh.org> wrote:
> the struct hack does not have the same dubiousness
> as the other things mentioned, such as assuming twos complement.
> Not only does the struct hack in practice work everywhere, but AFAIK
> no one has ever established hypothetical semantics for a compiler that
> would conform to the C standard but on which the struct hack would
> not work.
FWIW, I agree entirely; apologies if what I said seemed to be a
suggestion that we shouldn't rely on the struct hack. It's clearly
portable in practice, and I've unhesitatingly used it in the past.
>Aaron Crane wrote:
>> If someone were interested, I
>>think a little configure probing and preprocessor macrology could
>>arrange for C99-capable compilers to use flexible array members in
>>place of the struct hack in the Perl source.
>
> More fuss than it's worth. If you can't rely on the flexible array
> feature, you might as well just use the struct hack exclusively.
> It's never going to not work.
I think the big advantage of flexible array members is that the
structure type is incomplete, so we'd get compilation errors from
C99-capable smokers in the face of certain sorts of misuse of the
structures in question. But it's certainly not an itch I want to
scratch; and there's also the issue that those sorts of misuse just
aren't very likely to happen in practice, so the real benefit would
indeed be minimal.
--
Aaron Crane ** http://aaroncrane.co.uk/
Thread Previous
|
Thread Next