Re: void vs void* (philosophical question)



Chris Torek wrote:
[...]
(If I were in charge of things, I would probably make "void" an
ordinary object type whose size is zero, so that sizeof(void) ==
0; its value, upon conversion to any other scalar type, would be
zero. Thus:
[...]

How would you handle functions which don't return anything?

void foo()
{
void retval;

... do stuff ...

return retval;
}

And how would you resolve the use of an uninitialized variable for
the return?

Would you allow comparing voids, and void arithmetic?

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@xxxxxxxxx>

.



Relevant Pages

  • Re: void vs void* (philosophical question)
    ... ordinary object type whose size is zero, ... its value, upon conversion to any other scalar type, would be ... void retval; ...
    (comp.lang.c)
  • Re: void vs void* (philosophical question)
    ... ordinary object type whose size is zero, ... its value, upon conversion to any other scalar type, would be ... void retval; ... I think your not-quite-C language is consistent, ...
    (comp.lang.c)
  • Re: void vs void* (philosophical question)
    ... ordinary object type whose size is zero, ... its value, upon conversion to any other scalar type, would be ... void retval; ... Reading email is like searching for food in the garbage, ...
    (comp.lang.c)
  • Re: void vs void* (philosophical question)
    ... ordinary object type whose size is zero, ... its value, upon conversion to any other scalar type, would be ... void retval; ... Continuing from where Kenneth Brody left off. ...
    (comp.lang.c)
  • Re: Marshaling Value Types
    ... First, the void* params are concerning if they are pointers to actual data, ... > UINT32 Minor; ... The C# code give me a return value of zero for the> BioAPI_Init call, and both version.major and version.minor are zero. ... >>> I've read that, with the compact framework, MarshalAs is not available> and ...
    (microsoft.public.pocketpc.developer)

Quantcast