Click here to Skip to main content
14,880,797 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Signed integers considered harmful? Pin
Chris Losinger26-Sep-14 9:22
professionalChris Losinger26-Sep-14 9:22 
GeneralRe: Signed integers considered harmful? Pin
jeron126-Sep-14 9:25
Memberjeron126-Sep-14 9:25 
GeneralRe: Signed integers considered harmful? Pin
Richard Andrew x6426-Sep-14 9:34
professionalRichard Andrew x6426-Sep-14 9:34 
GeneralRe: Signed integers considered harmful? Pin
PIEBALDconsult26-Sep-14 9:45
professionalPIEBALDconsult26-Sep-14 9:45 
GeneralRe: Signed integers considered harmful? Pin
harold aptroot26-Sep-14 10:05
Memberharold aptroot26-Sep-14 10:05 
AnswerRe: Signed integers considered harmful? Pin
Richard MacCutchan26-Sep-14 10:14
mveRichard MacCutchan26-Sep-14 10:14 
GeneralRe: Signed integers considered harmful? Pin
harold aptroot26-Sep-14 10:19
Memberharold aptroot26-Sep-14 10:19 
AnswerRe: Signed integers considered harmful? Pin
CubbiMew29-Sep-14 16:44
MemberCubbiMew29-Sep-14 16:44 
Lots and lots of things in C++ (and C for that matter) can lead to undefined behavior if preconditions are not met. Signed integer arithmetic is just one of many. If you're programming in this language, you should be used to dealing with narrow contracts.

So, no, they shouldn't be avoided. Deal with them depending on the situation, in many cases an assert will suffice. Pretending it's not a problem is fatal.

(and no, gcc isn't the only compiler that assumes that naive signed overflow checks are always false)
QuestionVector index to iterator Pin
elelont225-Sep-14 23:45
Memberelelont225-Sep-14 23:45 
AnswerRe: Vector index to iterator Pin
«_Superman_»26-Sep-14 0:07
professional«_Superman_»26-Sep-14 0:07 
GeneralRe: Vector index to iterator Pin
elelont226-Sep-14 0:29
Memberelelont226-Sep-14 0:29 
GeneralRe: Vector index to iterator Pin
CPallini26-Sep-14 1:31
mveCPallini26-Sep-14 1:31 
QuestionConverting char* to double Pin
elelont225-Sep-14 21:37
Memberelelont225-Sep-14 21:37 
AnswerRe: Converting char* to double Pin
«_Superman_»25-Sep-14 22:43
professional«_Superman_»25-Sep-14 22:43 
GeneralRe: Converting char* to double Pin
elelont225-Sep-14 23:54
Memberelelont225-Sep-14 23:54 
GeneralRe: Converting char* to double Pin
Jochen Arndt26-Sep-14 2:04
professionalJochen Arndt26-Sep-14 2:04 
QuestionUnable to link C static library with Windows Store app when building ARM Pin
Thilina.madush24-Sep-14 15:36
MemberThilina.madush24-Sep-14 15:36 
SuggestionRe: Unable to link C static library with Windows Store app when building ARM Pin
Richard MacCutchan24-Sep-14 21:53
mveRichard MacCutchan24-Sep-14 21:53 
AnswerRe: Unable to link C static library with Windows Store app when building ARM Pin
jsolutions_uk24-Sep-14 21:59
Memberjsolutions_uk24-Sep-14 21:59 
QuestionSplit Window Pin
john563223-Sep-14 7:39
Memberjohn563223-Sep-14 7:39 
SuggestionRe: Split Window Pin
David Crow23-Sep-14 8:08
MemberDavid Crow23-Sep-14 8:08 
QuestionHow to capture Window messages on device shut down using MFC messages Pin
Member 1110344223-Sep-14 2:39
MemberMember 1110344223-Sep-14 2:39 
AnswerRe: How to capture Window messages on device shut down using MFC messages Pin
Richard MacCutchan23-Sep-14 3:26
mveRichard MacCutchan23-Sep-14 3:26 
QuestionEigen library : compile error Pin
includeh1022-Sep-14 23:18
Memberincludeh1022-Sep-14 23:18 
AnswerRe: Eigen library : compile error Pin
Richard MacCutchan23-Sep-14 1:51
mveRichard MacCutchan23-Sep-14 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.