I'm not sure about it... I think we need a C guru to clear it out.
(I'm not sure at all about this, but I try to explain how I understand it...)
For your 1st example:
Code:
void foo()
{
   return (void)anystuff;
}


In my opinion, this should work. As explained in Wikipedia:
Quote:
The void type serves as a unit type

So, why can't I return that unit type.
For the second part of the code:
Code:
void myvar = foo();


This doesn't work, because:
Quote:
the void type is said to comprise an empty set of values, and the language does not provide any way to declare an object or represent a value with type void


Your second example makes no sense for my use. I need to return the function value, if it is non-void...

Here are also the results if compiled with gcc (no warnings or errors, but that has nothing to say...):
http://ideone.com/BHcj3o
http://ideone.com/KTO19U