home bbs files messages ]

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

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

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

   Message 242,826 of 243,242   
   Michael Sanders to highcrew   
   Re: function pointer question   
   06 Jan 26 13:57:03   
   
   From: porkchop@invalid.foo   
      
   On Tue, 6 Jan 2026 13:59:20 +0100, highcrew wrote:   
      
   > On 1/6/26 1:32 PM, Michael Sanders wrote:   
   >>      “Evaluate *foo, but explicitly discard its value.”   
   >>   
   >>      It is a cast-to-void used to silence warnings about an   
   >>      unused expression or unused result.   
   >>   
   >> My question: Why?   
   >   
   > I'll throw a guess on the wall :)   
   >   
   > In C++ you might want to get side effect from some overloaded   
   > operator.  In C the only reason I could think of for for   
   > evaluating *foo and discarding the result would be if *foo   
   > was volatile, and in this way you are poking at some   
   > hardware-mapped address.   
      
   I can see that but... why not just declare as volatile in that case?   
      
   --   
   :wq   
   Mike Sanders   
      
   --- 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