[vorbis-dev] alloca() problem with CodeWarrior
Segher Boessenkool
segher at chello.nl
Thu Mar 14 17:49:38 PST 2002
> I agree with brian, if something didn't work on one pc out of a
> thousand, I would try and work around it,
Ah, like this:
-- the user might want to use gcc-2.95 on x86 with an OS distro that
thinks all the world is an intel pentium pro/2/iii
==> no fp comparisons, again.
-- the user might want to use gcc-2.91.66 on x86
==> we can't reliably use fp comparisons.
-- the user might want to use gcc-3.0.2 on ppc
==> we can't use floating point comparisons to 0.f
-- the user might want to use MSVC older than, erm, 5 I think
==> we can't reliably use floats in static initializers.
-- the user might want to use some older CW version
==> we must make sure all our structs and stack parameter frames
are 16-byte aligned, in case the user has enabled some goofy
compiler options and expects the resulting lib to play nice
with other libs.
Just some of the compiler bugs I noticed while hacking Vorbis (well, #2
wasn't discovered by me, and #5 was a well-known bug already. And there
already was a compiler fix for it).
All of these happen more than 1 in 1000 users, and none of these can
be worked around without huge sacrifices in either code speed or
legibility or maintainability or whatever.
<p>Yes, we don't use C99 features, because not every compiler has it.
But we won't go as far as writing everything K&R compatible.
Whether or not to use alloca() is somewhere inbetween.
<p>Segher
<p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis-dev
mailing list