T.R | Title | User | Personal Name | Date | Lines |
---|
3469.1 | | MOIRA::FAIMAN | Wandrer, du M�der, du bist zu Haus | Thu Feb 27 1997 11:12 | 11 |
| ARM �8.2.5 and draft standard �8.3.5 state
The parameter list (void) is equivalent to the empty parameter list.
Note that they do *not* say that "a parameter list containing only a single
parameter declaration which declares a parameter whose type is void is
equivalent to the empty parameter list."
I.e., in this construct "void" is a keyword, not a type name.
-Neil
|
3469.2 | void related compilation problem | TUXEDO::LU | | Thu Feb 27 1997 14:48 | 7 |
| Appreciate the effort for looking up the C++ references.
I am actually more perplexed than before so bear with me a little.
In my little example, if DECCXX treats the void as a keywork and not a type name then why
it thinks the function actually has ONE parameter?
-James
|
3469.3 | does this answer your question? | MUCTEC::BECKER | Hartmut B., VMS & Languages, Munich | Fri Feb 28 1997 06:12 | 28 |
| re .2
In C (and C++) you only need a type specifier in the function declaration, you
don't need a mparameter name. In C++ even in the definition, you don't need the
parameter name, if it isn't referenced. But you have to supply an argument
when you call it. For example
void foo (int); // declaration, only type specifier
void bar (void) {
foo (1); // actual call, argument necessary
}
void foo (int) { // definition, parameter not referenced
}
compiles with C++ (doesn't with C).
If you call foo the compiler expects an argument. As you can see this isn't
different from your example. Your type is MY_VOID, hence you have to supply an
argument of type MY_VOID (which can't be done, but that's another story).
But that's not what I think you wanted. Maybe a '#define MY_VOID void' can do
the job for you.
Hope this is an answer to what I think was your question,
Hartmut
|
3469.4 | yes, my question has been answered | TUXEDO::LU | | Fri Feb 28 1997 13:07 | 5 |
| Thanks for both re. 1 and 3. Your answers lead to my conclustion that it's a Microsoft-ism,
and I am not sure if it's a MS compiler's bug or feature. In any event, appreciate for the time and effort
for answering the question.
-James
|
3469.5 | Microsoft extension, supported in V6.0 | DECCXX::AMARTIN | Alan H. Martin | Fri Feb 28 1997 15:28 | 18 |
| Re .4:
>Thanks for both re. 1 and 3. Your answers lead to my conclustion that it's a
>Microsoft-ism, and I am not sure if it's a MS compiler's bug or feature. ...
It's a non-standard extension (and I bet Microsoft never knew they were
extending the language).
DEC C++ V6.0 will accept that use of a typedefed void under -ms mode.
(However, it will possibly warn about the lack of a return type in bar's
definition, since ANSI requires that):
"void.cxx", line 4: warning: omission of explicit type is nonstandard ("int"
assumed)
bar()
^
/AHM
|
3469.6 | the release time frame for DEC C++ V6.0 | TUXEDO::LU | | Mon Mar 03 1997 10:23 | 6 |
| Re .5:
It's wonderful that DEC C++ V6.0 will support this additional MS dialect.
What's the release time frame for V6.0?
-James
|
3469.7 | Schedule info for V6.0 | DECCXX::MITCHELL | | Mon Mar 03 1997 12:13 | 2 |
| On Digital UNIX, we expect to start V6.0 alpha test in
Aug-97 and beta test in Sep-97.
|