Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Thread Closed: Issue successfully resolved

???
01/24/04 05:33
Read: times


 
#63275 - RE: Alternate C Guidelines
Responding to: ???'s previous message
First of all it is ALWAYS best to write the code in a way that states explicitly what you intend it to do.

The other point is that FALSE is always zero. TRUE is often set as NOT FALSE so if a routine says it returns TRUE it may send back FF, or 1 or any other non-zero value.

Best to write with the explicit comparison every time and keep all code the same structure.

To many times if you write:

if(func())
{
....

You will get into trouble sometime when you use func() in more places than one and someday it gets decided to change it from 2 return values to three values. The above statement would accept maybe two of the return values when it was supposed to be just one of them.

Sorry my answer is choppy.....hope it is clear.

Michael Karas


List of 29 messages in thread
TopicAuthorDate
MISRA C Guidelines            01/01/70 00:00      
   RE: MISRA C Guidelines            01/01/70 00:00      
      RE: Alternate C Guidelines            01/01/70 00:00      
         RE: Alternate C Guidelines            01/01/70 00:00      
         RE: Alternate C Guidelines            01/01/70 00:00      
            RE: Alternate C Guidelines            01/01/70 00:00      
      RE: MISRA C Guidelines            01/01/70 00:00      
         RE: MISRA C Guidelines            01/01/70 00:00      
            RE: MISRA C Guidelines            01/01/70 00:00      
               RE: MISRA C Guidelines            01/01/70 00:00      
            RE: MISRA C Guidelines            01/01/70 00:00      
   Hitex have a deal...            01/01/70 00:00      
      RE: Hitex have a deal...            01/01/70 00:00      
         RE: Hitex have a deal...            01/01/70 00:00      
            RE: Hitex have a deal...            01/01/70 00:00      
               RE: Hitex have a deal...            01/01/70 00:00      
                  RE: Hitex have a deal...            01/01/70 00:00      
               Not guilty, mlud            01/01/70 00:00      
                  RE: Not guilty, mlud            01/01/70 00:00      
                     RE: Not guilty, mlud            01/01/70 00:00      
                        RE: Not guilty, mlud            01/01/70 00:00      
                        RE: Not guilty, mlud            01/01/70 00:00      
                     RE: Not guilty, mlud            01/01/70 00:00      
                     RE: Not guilty, mlud            01/01/70 00:00      
                        RE: Not guilty, mlud            01/01/70 00:00      
               RE: Hitex have a deal...            01/01/70 00:00      
   Jack Ganssle on the MISRA Guidelines            01/01/70 00:00      
   RE: MISRA C Guidelines            01/01/70 00:00      
      RE: MISRA C Guidelines            01/01/70 00:00      

Back to Subject List