Re: Network byte order and floating-point numbers

From: Phil Frisbie, Jr. (phil_at_hawksoft.com)
Date: 06/14/04


Date: Mon, 14 Jun 2004 20:28:20 GMT

Owen Jacobson wrote:

> On Sun, 13 Jun 2004 17:53:42 +0200, Reinder Verlinde wrote:
>
>
>>In article <pan.2004.06.07.01.35.23.59926@lionsanctuary.net>,
>> Owen Jacobson <angstrom@lionsanctuary.net> wrote:
>>
>>
>>>the actual protocol is based on sending struct{...}s over the connection.
>>
>>If you mean that you write sizeof( aStruct) bytes, passing a pointer to
>>aStruct: that is not even portable between equal-endian systems.
>>Different systems, compilers or even compiler settings will lead to
>>different padding inside structures.
>
> I'm well aware of that. Unfortunately, the guys involved in writing the
> server half of the application are very much Windows people, where this is
> normal behaviour and even works reasonably well (between Windows machines).

Yes, WinTel programmers tend to ignore potential problems like that, but it is
STILL not good programming practice. I have seen Windows only programs get
toasted because the structure alignment setting was inadvertently changed and
all of the sudden structures sent between different versions were garbled ;)

-- 
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com


Relevant Pages

  • Re: Referencing an object via variable.
    ... sort, but I figured that if windows already has this information, then ... >the pointer you need at the start. ... We're programmers ...
    (alt.comp.lang.borland-delphi)
  • Re: Simple New Ruby Programmer Problem with $stdin.gets
    ... the mark of a professional programmer to work with any environment. ... Programmers, myself included, tend to ... the Windows environment. ... programmers use the command line to run programs. ...
    (comp.lang.ruby)
  • Re: Cleaning and maintaining the registry
    ... > Kerry Brown wrote: ... Windows 2000 and XP store the registry in several files. ... but with so many programmers thinking their way ...
    (microsoft.public.windowsxp.general)
  • Re: huge array
    ... I try to avoid unmanaged calls when I can - especially to the windows ... XPSP1 support ended 3 years ago. ... You like to talk about Mono on Linux but Mono is not ... demoting 3rd-party programmers and providing ...
    (microsoft.public.vb.general.discussion)
  • Re: Theodore Adorno, a prophet of data systems design
    ... > Which is why I work in Windows because the language development is ... I concede that much work needs to be done in language development ... It is not just C and C programmers who have this pact. ... the ignition system has to do a lot more than help the car start. ...
    (comp.programming)