Topic: Proposal for C++0x: return 1; statement


Author: ivr@guesswh.at.emails.ru ("Ioannis Vranos")
Date: Fri, 16 Apr 2004 04:17:08 +0000 (UTC)
Raw View
===================================== MODERATOR'S COMMENT:
 Don't worry about it, it happens.  :-)


===================================== END OF MODERATOR'S COMMENT
""Ioannis Vranos"" <ivr@otenet.gr> wrote in message
news:c5mcr0$1s66$1@ulysses.noc.ntua.gr...
> Now it may sound a bit stupid in the beginning. I was talking with someone
> who was using return 1; in main() to signal errors because
>
> #include <cstdlib>
>
>
> return EXIT_FAILURE;
>
>
> is tiresome to write and also difficult for newbies to understand it.
>
>
> Wouldn't it be better if this was added in the upcoming standard as a
> portable way to signal error? Essentially, return 1; to be equivalent to
> return EXIT_FAILURE; as return 0; is equivalent to return EXIT_SUCCESS;


Sorry for these many identical messages but it seems that all moderators
live in USA and i live in EU. Next time i shall wait more than 12 hours
before reposting.






Ioannis Vranos

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: ark@acm.org ("Andrew Koenig")
Date: Fri, 16 Apr 2004 15:33:41 +0000 (UTC)
Raw View
> Wouldn't it be better if this was added in the upcoming standard as a
> portable
> way to signal error? Essentially, return 1; to be equivalent to return
> EXIT_FAILURE; as return 0; is equivalent to return EXIT_SUCCESS;

I am fairly certain that VMS treats "return 1" as success.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: ivr@guesswh.at.emails.ru ("Ioannis Vranos")
Date: Thu, 15 Apr 2004 17:48:38 +0000 (UTC)
Raw View
Now it may sound a bit stupid in the beginning. I was talking with someone
who was using return 1; in main() to signal errors because

#include <cstdlib>


return EXIT_FAILURE;


is tiresome to write and also difficult for newbies to understand it.


Wouldn't it be better if this was added in the upcoming standard as a
portable
way to signal error? Essentially, return 1; to be equivalent to return
EXIT_FAILURE; as return 0; is equivalent to return EXIT_SUCCESS;






Ioannis Vranos

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: ivr@otenet.gr ("Ioannis Vranos")
Date: Fri, 16 Apr 2004 00:49:01 +0000 (UTC)
Raw View
Now it may sound a bit stupid in the beginning. I was talking with someone
who was using return 1; in main() to signal errors because

#include <cstdlib>


return EXIT_FAILURE;


is tiresome to write and also difficult for newbies to understand it.


Wouldn't it be better if this was added in the upcoming standard as a
portable way to signal error? Essentially, return 1; to be equivalent to
return EXIT_FAILURE; as return 0; is equivalent to return EXIT_SUCCESS;






Ioannis Vranos

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]