[prev in list] [next in list] [prev in thread] [next in thread]
List: kdevelop-devel
Subject: Re: Review Request: Fix crash when KTextEdit::Factory is not found
From: Esben Mose Hansen <kde () mosehansen ! dk>
Date: 2011-04-06 7:37:29
Message-ID: 201104060937.29315.kde () mosehansen ! dk
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
On Monday 04 April 2011 13:49:42 Robert Mathias Marmorstein wrote:
> The exit status actually gets bitwise anded with the octal value 377, so
> both -1 and 1 return non-zero. The -1 exit status is a standard for some
> projects (linux kernel? I forget), while an exit status of "1" is also
> often used in Unix. Ordinarily it doesn't matter, but using either of the
> numeric values can cause portability issues. The new standard is to use
> "EXIT_SUCCESS" and "EXIT_FAILURE" macros to be more portable, so I have
> changed the code to use "EXIT_FAILURE", tested (it works), and committed.
Ignoring buggy compilers, it really shouldn't matter. Returning any non-zero
value from main (or via. exit) should give a return code that indicates
failure, and returning zero should give a return code that indicates success.
So even if you managed to find a system where 0 = failure, a "return 0;" from
the main() method will *still* indicate success.
--
kind regards, Esben
[Attachment #5 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'DejaVu Sans Mono'; font-size:12pt; font-weight:400; \
font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Monday 04 April \
2011 13:49:42 Robert Mathias Marmorstein wrote:</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">> The exit status actually gets bitwise anded with the octal value 377, \
so</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> both -1 and 1 return non-zero. \
The -1 exit status is a standard for some</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> \
projects (linux kernel? I forget), while an exit status of "1" is also</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> often used in Unix. Ordinarily it \
doesn't matter, but using either of the</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> \
numeric values can cause portability issues. The new standard is to use</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">> "EXIT_SUCCESS" and "EXIT_FAILURE" \
macros to be more portable, so I have</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> \
changed the code to use "EXIT_FAILURE", tested (it works), and committed.</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">Ignoring buggy compilers, it really shouldn't matter. \
Returning any non-zero value from main (or via. exit) should give a return code that indicates \
failure, and returning zero should give a return code that indicates success. </p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">So even if you managed to find a system where 0 = failure, \
a "return 0;" from the main() method will *still* indicate success. </p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">-- </p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">kind \
regards, Esben</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br \
/></p></body></html>
--
KDevelop-devel mailing list
KDevelop-devel@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic