|
-
Nov 21st, 2001, 05:16 PM
#10
CB - For what its worth - I was just qutoting the standard.
It defines:
what is required and has to be supported.
what is optional but has to be supported.
That's all.
Using your point of view the real C99 ANSI standard might be something interesting like this:
Code:
int main(int argc, char *argv[], char *envp)
(I made this example up, C99 doesn't provide required support for the envp pointer, but most do allow it)
not because you need any of them but because they are available. The C99 ANSI standard lists these args as optional, with datatype for arguments required. It doesn't say which one you have to use.
Therefore:
void is okay.
meets the standard. Even if it's ugly.
ANSI C is a moving target. It changes. Currently the above code compiles with my C99 ANSI-compliant compiler on HPUX. It is marginal practice, I think, but legal.
Unfortunately, I'm not making this up, I've got the ANSI C99 standards (in an appendix) in a book on my desk. Somewhere. Under the paper.
You may want to consider common good practice separate from all ANSI standards. You use good practice. The ANSI standard is often less. Way less.
You don't like setjmp() and longjmp(). But they are part of the standard, too.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|