Click here to Skip to main content
16,005,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: array -- foo, &foo and &foo[0] Pin
Iain Clarke, Warrior Programmer13-Aug-07 22:46
Iain Clarke, Warrior Programmer13-Aug-07 22:46 
GeneralRe: array -- foo, &foo and &foo[0] Pin
George_George13-Aug-07 23:23
George_George13-Aug-07 23:23 
GeneralRe: array -- foo, &foo and &foo[0] Pin
Iain Clarke, Warrior Programmer13-Aug-07 23:36
Iain Clarke, Warrior Programmer13-Aug-07 23:36 
GeneralRe: array -- foo, &foo and &foo[0] Pin
George_George13-Aug-07 23:50
George_George13-Aug-07 23:50 
QuestionDisabling shortcut in Visual C++ [modified] Pin
jimfisher13-Aug-07 18:15
jimfisher13-Aug-07 18:15 
AnswerRe: Disabling shortcut in Visual C++ Pin
Iain Clarke, Warrior Programmer13-Aug-07 22:56
Iain Clarke, Warrior Programmer13-Aug-07 22:56 
QuestionRe: Disabling shortcut in Visual C++ Pin
David Crow14-Aug-07 3:12
David Crow14-Aug-07 3:12 
AnswerRe: Disabling shortcut in Visual C++ Pin
jimfisher14-Aug-07 5:20
jimfisher14-Aug-07 5:20 
when building software for avionics (DO-178B) Level A (critical to safety) one must test every path in the code.

The difficult paths to prove they have been taken are generally the "shortcut" paths. Thus it is often easier to test the crash cases yourself as:

if(pointer != NULL)
{
if(pointer->object)
{
do whatever

One can still do this even with short cutting, it is just expressions such as:

if((A || B) && (C || D))

These have several shortcut paths.

To defeat this, one could convert the bools to unsigned int and

// no shortcutting on bit ops as the compiler thinks I need all 16 bits
X = (A | B) & (C | D);
if(X != 0)
{
do this or that

But this seems more awkward and harder to manage (code reviews etc) than just defeating the shortcut code generation...

Make sense or no?




Jim Fisher
Questionfatal error C1001: INTERNAL COMPILER ERROR Pin
itkid13-Aug-07 18:11
itkid13-Aug-07 18:11 
AnswerRe: fatal error C1001: INTERNAL COMPILER ERROR Pin
jimfisher13-Aug-07 18:20
jimfisher13-Aug-07 18:20 
GeneralRe: fatal error C1001: INTERNAL COMPILER ERROR Pin
itkid15-Aug-07 20:35
itkid15-Aug-07 20:35 
Questionhow to know a double is infinite directly? Pin
includeh1013-Aug-07 18:00
includeh1013-Aug-07 18:00 
GeneralRe: how to know a double is infinite directly? Pin
Maxwell Chen13-Aug-07 19:04
Maxwell Chen13-Aug-07 19:04 
AnswerRe: how to know a double is infinite directly? Pin
Mark Salsbery14-Aug-07 6:05
Mark Salsbery14-Aug-07 6:05 
QuestionApplication that use DataGrid ActiveX Control dont work without VC++ installed Pin
xanagan13-Aug-07 17:13
xanagan13-Aug-07 17:13 
AnswerRe: Application that use DataGrid ActiveX Control dont work without VC++ installed Pin
Maxwell Chen13-Aug-07 17:46
Maxwell Chen13-Aug-07 17:46 
AnswerRe: Application that use DataGrid ActiveX Control dont work without VC++ installed Pin
Paresh Chitte13-Aug-07 18:51
Paresh Chitte13-Aug-07 18:51 
GeneralVisual Studio 2003/2005 name mangling Pin
Harald Krause13-Aug-07 15:42
Harald Krause13-Aug-07 15:42 
GeneralRe: Visual Studio 2003/2005 name mangling Pin
Maxwell Chen13-Aug-07 17:08
Maxwell Chen13-Aug-07 17:08 
QuestionDrawing Data Flow Digram Pin
Rajesh Rajan Pankapattu13-Aug-07 8:48
Rajesh Rajan Pankapattu13-Aug-07 8:48 
QuestionObtain class digram Pin
Rajesh Rajan Pankapattu13-Aug-07 8:36
Rajesh Rajan Pankapattu13-Aug-07 8:36 
QuestionDesign question for using derived class/ Multiple Base classes Pin
ForNow13-Aug-07 6:36
ForNow13-Aug-07 6:36 
AnswerRe: Design question for using derived class/ Multiple Base classes Pin
jhwurmbach13-Aug-07 6:47
jhwurmbach13-Aug-07 6:47 
GeneralRe: Design question for using derived class/ Multiple Base classes Pin
ForNow13-Aug-07 12:01
ForNow13-Aug-07 12:01 
AnswerRe: Design question for using derived class/ Multiple Base classes Pin
led mike13-Aug-07 7:10
led mike13-Aug-07 7:10 

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.