home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 13,645 of 14,669   
   glen herrmannsfeldt to Barry Margolin   
   Re: htonl()/ntohl() evaluation?   
   09 Oct 10 05:08:35   
   
   t-delegated.example.com> 31ce477a   
   From: gah@ugcs.caltech.edu   
      
   Barry Margolin  wrote:   
   > In article ,   
   (snip)   
      
   >> Jorgen Grahn  wrote:   
   >> > A brief question: are htonl(), ntohl() and friends allowed to   
   >> > evaluate their argument more than once (i.e. if they're implemented   
   >> > naively as macros?)   
   (snip)   
      
   > I think the general expectation is that if something is described as a   
   > function in some specification, it should behave like a function.  If   
   > you decide to implement it using a macro, you have to maintain the   
   > functional semantics.   
      
   > But why would you implement this as a macro?  Standard C has had inline   
   > functions for more than a decade.   
      
   On correctly designed processors it is a No-Op, and most others have   
   them as one instruction.  Compilers should be able to inline them.   
      
   -- glen   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca