Any DR filed for 5.1.2.2.1.1: Implementation dependent form of main?

  • Thread starter null hypothesis
  • Start date
N

null hypothesis

I have seen more confusion than help when interpreting
the last part of 5.1.2.2.1.1:

[...]or in some other implementation-defined manner.

I have searched the archives and seem to understand
that experts like Chris Torek consider this a defect. See
http://groups.google.com/group/comp.lang.c/msg/c1a1cc0a23af7227
and http://groups.google.com/group/comp.std.c/msg/7340b025f5fe8657
for reference.

Questions:

1. Has a DR been filed for this issue? (My efforts at
retrieving anything similar from open-std.org failed.)

2. Assuming that such a DR has not been filed, would
not it be better to have one in keeping with the
spirit of the "Minimize incompatibilities with C++."
item from the C99 Rationale? (AFAIK, C++03 fixes
the return type of main as int always.)
 
E

Eric Sosman

I have seen more confusion than help when interpreting
the last part of 5.1.2.2.1.1:

[...]or in some other implementation-defined manner.

Side-issue: It is customary to string section and subsection
numbers together with dots, as the Standard itself does, but to
use some other convention (like "5.1.2.2.1p1" or "5.1.2.2.1/1")
to distinguish the paragraph numbers. This particular citation
isn't too confusing, but something like "5.1.2.2.1" would be
ambiguous in your system (it might mean "section 5.1.2.2.1" or
"section 5.1.2.2 paragraph 1").
I have searched the archives and seem to understand
that experts like Chris Torek consider this a defect. See
http://groups.google.com/group/comp.lang.c/msg/c1a1cc0a23af7227
and http://groups.google.com/group/comp.std.c/msg/7340b025f5fe8657
for reference.

Questions:

1. Has a DR been filed for this issue? (My efforts at
retrieving anything similar from open-std.org failed.)

I haven't heard of one -- but then, I'm just a spectator, not
a player, in the Standard-writing game. Perhaps comp.std.c would
be a better newsgroup for the question. (Follow-ups set.)
2. Assuming that such a DR has not been filed, would
not it be better to have one in keeping with the
spirit of the "Minimize incompatibilities with C++."
item from the C99 Rationale? (AFAIK, C++03 fixes
the return type of main as int always.)

Again, comp.std.c might be better. But for what it's worth,
I don't see any "incompatibility" between C and C++ in this matter.
Every (hosted) C implementation supports the two specified forms
for main(), and some may support additional forms. If C++ does not
allow those forms -- well, the C programmer is not obliged to use
them, is he? If he uses an exotic main() that his implementation
happens to support, he does so either out of ignorance or because
he actually wants the exotic effect -- and he gets into trouble only
if he moves his code to an implementation whose idiosyncracies are
different.

C++ implementations may be among those that will make trouble
for the programmer with a strange main(), but I don't see that as
a problem for either language. If ignorance is the reason for the
strangeness, a useful instruction will be supplied. And if he truly
needs the C-specific exoticism, he can't port to C++ anyhow.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top