[vorbis-dev] Re: Different average bitrates on different machines

Cameron Simpson cs at zip.com.au
Tue Dec 11 12:31:08 PST 2001



On Tue, Dec 11, 2001 at 02:27:45AM -0500, Daniel B. Miller <dan at ON2.COM> wrote:
| well I wouldn't defend it to the death, but it seems clear to me that a
| post-increment should be 'post' whatever else goes on in the statement.  I
| would be surprised if any compilers compiled this differently.

Then your code's rubbish. Go and _read_ the language spec please,
instead of depending on the compiler to implement the "DWIM" or "DWIW"
instructions.  Post increment is only post that particular use of
the value in the expression. It need not be post anything else in the
expression. Nor are expressions necessarily evaluated left to right
(syntacticly grouped, for some constructs, yes, but not _evaluated_).

| Not that it wouldn't be nice to have a warning-free codebase -- but that's
| more of a platonic ideal than a common reality IMHO.

I'll be happy to keep you away from my code then. The warnings are there
to highlight places of dodgy code when the freedom of the compiler
to adhere to the standard in different ways for different purposes
(speed, economy of memory use, economy of register usage, etc etc) or
where different compilers on different processors may make different
tradeoffs or use different type sizes and representations may lead to
differing behaviour because YOU, the programmer, have not been precise
enough about what you want.

There's a lot of crap nonportable code out there. _Many_ subtle portablity
bugs can be caught early by a rigourous attention to the various compiler
warnings and some effort in removing them.

The standard is _deliberately_ vague about some things in maximise the
ability of the compiler to make use of the hardware, and to maximise the
number of different systems on which the language and libraries may be
implemented. It is the programmer's responsibilty to be as precise as
necessary to get exactly the desired behaviour.

--
Cameron Simpson, DoD#743        cs at zip.com.au    http://www.zip.com.au/~cs/

If you lie to the compiler, it will get its revenge.	- Henry Spencer

--- >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