If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

C-style casts rather than C++ casts?

RESOLVED WONTFIX

Status

MailNews Core
MIME
P3
normal
RESOLVED WONTFIX
17 years ago
4 years ago

People

(Reporter: Bruce Mitchener, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
Should these be using NS_REINTERPRET_CAST() or NS_STATIC_CAST()?  (Does the fact 
that they are structs rather than classes make a difference either way as to the 
safety of what's going on and how the compiler handles it?)

Warning 749: "mimeeobj.cpp", line 34 # The cast from 'MimeLeafClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
    MimeDefClass(MimeExternalObject, MimeExternalObjectClass,
    ^^^^^^^^^^^^                                             
Warning 749: "mimeeobj.cpp", line 53 # The cast from 'MimeExternalObjectClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      MimeObjectClass *oclass = (MimeObjectClass *) clazz;
                                ^^^^^^^^^^^^^^^^^^^       
Warning 749: "mimeeobj.cpp", line 54 # The cast from 'MimeExternalObjectClass *' 
to 'MimeLeafClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      MimeLeafClass   *lclass = (MimeLeafClass *) clazz;
                                ^^^^^^^^^^^^^^^^^       
Warning 749: "mimeeobj.cpp", line 71 # The cast from 'MimeLeafClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      return ((MimeObjectClass*)&MIME_SUPERCLASS)->initialize(object);
              ^^^^^^^^^^^^^^^^^^                                      
Warning 749: "mimeeobj.cpp", line 77 # The cast from 'MimeLeafClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      ((MimeObjectClass*)&MIME_SUPERCLASS)->finalize(object);
       ^^^^^^^^^^^^^^^^^^                                    
Warning 749: "mimeeobj.cpp", line 86 # The cast from 'MimeLeafClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_begin(obj);
                ^^^^^^^^^^^^^^^^^^                                    
Warning 749: "mimeeobj.cpp", line 223 # The cast from 'MimeLeafClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
              return ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_buffer(buffer, 
size,
                      ^^^^^^^^^^^^^^^^^^                                        
     

Warning 749: "mimei.cpp", line 314 # The cast from 'MimeUntypedTextClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
          clazz = (MimeObjectClass *)&mimeUntypedTextClass;
                  ^^^^^^^^^^^^^^^^^^^                      
Warning 749: "mimei.cpp", line 321 # The cast from 'MimeInlineTextHTMLClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeInlineTextHTMLClass;
                    ^^^^^^^^^^^^^^^^^^^                         
Warning 749: "mimei.cpp", line 323 # The cast from 'MimeInlineTextEnrichedClass 
*' to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation 
is non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeInlineTextEnrichedClass;
                    ^^^^^^^^^^^^^^^^^^^                             
Warning 749: "mimei.cpp", line 325 # The cast from 'MimeInlineTextRichtextClass 
*' to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation 
is non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeInlineTextRichtextClass;
                    ^^^^^^^^^^^^^^^^^^^                             
Warning 749: "mimei.cpp", line 327 # The cast from 'MimeExternalObjectClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeExternalObjectClass;
                    ^^^^^^^^^^^^^^^^^^^                         
Warning 749: "mimei.cpp", line 350 # The cast from 
'MimeInlineTextPlainFlowedClass *' to 'MimeObjectClass *' is performed as a 
'reinterpret_cast'. This operation is non-portable and potentially unsafe.
              clazz = (MimeObjectClass *)&mimeInlineTextPlainFlowedClass;
                      ^^^^^^^^^^^^^^^^^^^                                
Warning 749: "mimei.cpp", line 352 # The cast from 'MimeInlineTextPlainClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
              clazz = (MimeObjectClass *)&mimeInlineTextPlainClass;
                      ^^^^^^^^^^^^^^^^^^^                          
Warning 749: "mimei.cpp", line 359 # The cast from 'MimeInlineTextPlainClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeInlineTextPlainClass;
                    ^^^^^^^^^^^^^^^^^^^                          
Warning 749: "mimei.cpp", line 367 # The cast from 
'MimeMultipartAlternativeClass *' to 'MimeObjectClass *' is performed as a 
'reinterpret_cast'. This operation is non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeMultipartAlternativeClass;
                    ^^^^^^^^^^^^^^^^^^^                               
Warning 749: "mimei.cpp", line 369 # The cast from 'MimeMultipartRelatedClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeMultipartRelatedClass;
                    ^^^^^^^^^^^^^^^^^^^                           
Warning 749: "mimei.cpp", line 371 # The cast from 'MimeMultipartDigestClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeMultipartDigestClass;
                    ^^^^^^^^^^^^^^^^^^^                          
Warning 749: "mimei.cpp", line 374 # The cast from 
'MimeMultipartAppleDoubleClass *' to 'MimeObjectClass *' is performed as a 
'reinterpret_cast'. This operation is non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeMultipartAppleDoubleClass;
                    ^^^^^^^^^^^^^^^^^^^                               
Warning 749: "mimei.cpp", line 376 # The cast from 'MimeMultipartParallelClass 
*' to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation 
is non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeMultipartParallelClass;
                    ^^^^^^^^^^^^^^^^^^^                            
Warning 749: "mimei.cpp", line 378 # The cast from 'MimeMultipartMixedClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeMultipartMixedClass;
                    ^^^^^^^^^^^^^^^^^^^                         
Warning 749: "mimei.cpp", line 406 # The cast from 'MimeMultipartMixedClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeMultipartMixedClass;
                    ^^^^^^^^^^^^^^^^^^^                         
Warning 749: "mimei.cpp", line 415 # The cast from 'MimeMessageClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeMessageClass;
                    ^^^^^^^^^^^^^^^^^^^                  
Warning 749: "mimei.cpp", line 417 # The cast from 'MimeExternalBodyClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeExternalBodyClass;
                    ^^^^^^^^^^^^^^^^^^^                       
Warning 749: "mimei.cpp", line 420 # The cast from 'MimeExternalObjectClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeExternalObjectClass;
                    ^^^^^^^^^^^^^^^^^^^                         
Warning 749: "mimei.cpp", line 423 # The cast from 'MimeInlineTextPlainClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
            clazz = (MimeObjectClass *)&mimeInlineTextPlainClass;
                    ^^^^^^^^^^^^^^^^^^^                          
Warning 749: "mimei.cpp", line 435 # The cast from 'MimeInlineImageClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
          clazz = (MimeObjectClass *)&mimeInlineImageClass;
                  ^^^^^^^^^^^^^^^^^^^                      
Warning 749: "mimei.cpp", line 446 # The cast from 'MimeInlineTextPlainClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
        clazz = (MimeObjectClass *)&mimeInlineTextPlainClass;
                ^^^^^^^^^^^^^^^^^^^                          
Warning 749: "mimei.cpp", line 449 # The cast from 'MimeSunAttachmentClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
          clazz = (MimeObjectClass *)&mimeSunAttachmentClass;
                  ^^^^^^^^^^^^^^^^^^^                        
Warning 749: "mimei.cpp", line 454 # The cast from 'MimeExternalObjectClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
          clazz = (MimeObjectClass *)&mimeExternalObjectClass;  
                  ^^^^^^^^^^^^^^^^^^^                           
Warning 749: "mimei.cpp", line 560 # The cast from 'MimeContainerClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      else if (mime_subclass_p(clazz,(MimeObjectClass *)&mimeContainerClass) &&
                                     ^^^^^^^^^^^^^^^^^^^                       
Warning 749: "mimei.cpp", line 561 # The cast from 'MimeMessageClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
                       !mime_subclass_p(clazz,(MimeObjectClass 
*)&mimeMessageClass))
                                              ^^^^^^^^^^^^^^^^^^^               
    
Warning 749: "mimei.cpp", line 589 # The cast from 'MimeInlineTextHTMLClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
        if (  (clazz != (MimeObjectClass *)&mimeInlineTextHTMLClass) &&
                        ^^^^^^^^^^^^^^^^^^^                            
Warning 749: "mimei.cpp", line 590 # The cast from 'MimeInlineTextClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
              (clazz != (MimeObjectClass *)&mimeInlineTextClass) &&
                        ^^^^^^^^^^^^^^^^^^^                        
Warning 749: "mimei.cpp", line 591 # The cast from 'MimeInlineTextPlainClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
              (clazz != (MimeObjectClass *)&mimeInlineTextPlainClass) &&
                        ^^^^^^^^^^^^^^^^^^^                             
Warning 749: "mimei.cpp", line 592 # The cast from 
'MimeInlineTextPlainFlowedClass *' to 'MimeObjectClass *' is performed as a 
'reinterpret_cast'. This operation is non-portable and potentially unsafe.
              (clazz != (MimeObjectClass *)&mimeInlineTextPlainFlowedClass) &&
                        ^^^^^^^^^^^^^^^^^^^                                   
Warning 749: "mimei.cpp", line 593 # The cast from 'MimeInlineTextHTMLClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
              (clazz != (MimeObjectClass *)&mimeInlineTextHTMLClass) &&
                        ^^^^^^^^^^^^^^^^^^^                            
Warning 749: "mimei.cpp", line 594 # The cast from 'MimeInlineTextRichtextClass 
*' to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation 
is non-portable and potentially unsafe.
              (clazz != (MimeObjectClass *)&mimeInlineTextRichtextClass) &&
                        ^^^^^^^^^^^^^^^^^^^                                
Warning 749: "mimei.cpp", line 595 # The cast from 'MimeInlineTextEnrichedClass 
*' to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation 
is non-portable and potentially unsafe.
              (clazz != (MimeObjectClass *)&mimeInlineTextEnrichedClass) &&
                        ^^^^^^^^^^^^^^^^^^^                                
Warning 749: "mimei.cpp", line 596 # The cast from 'MimeMessageClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
              (clazz != (MimeObjectClass *)&mimeMessageClass) &&
                        ^^^^^^^^^^^^^^^^^^^                     
Warning 749: "mimei.cpp", line 597 # The cast from 'MimeInlineImageClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
              (clazz != (MimeObjectClass *)&mimeInlineImageClass) )
                        ^^^^^^^^^^^^^^^^^^^                        
Warning 749: "mimei.cpp", line 598 # The cast from 'MimeExternalObjectClass *' 
to 'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
          clazz = (MimeObjectClass *)&mimeExternalObjectClass;
                  ^^^^^^^^^^^^^^^^^^^                         
Warning 749: "mimei.cpp", line 709 # The cast from 'MimeObject *' to 
'MimeContainer *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
              MimeContainer *cont = (MimeContainer *) obj->parent;
                                    ^^^^^^^^^^^^^^^^^             
Warning 749: "mimei.cpp", line 912 # The cast from 'MimeContainerClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      else if (!mime_typep(obj, (MimeObjectClass *) &mimeContainerClass))
                                ^^^^^^^^^^^^^^^^^^^                      
Warning 749: "mimei.cpp", line 920 # The cast from 'MimeObject *' to 
'MimeContainer *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
              MimeContainer *cont = (MimeContainer *) obj;
                                    ^^^^^^^^^^^^^^^^^     
Warning 749: "mimei.cpp", line 967 # The cast from 
'MimeMultipartAppleDoubleClass *' to 'MimeObjectClass *' is performed as a 
'reinterpret_cast'. This operation is non-portable and potentially unsafe.
                                     (MimeObjectClass *) 
&mimeMultipartAppleDoubleClass))
                                     ^^^^^^^^^^^^^^^^^^^                        
         
Warning 749: "mimei.cpp", line 973 # The cast from 
'MimeMultipartAppleDoubleClass *' to 'MimeObjectClass *' is performed as a 
'reinterpret_cast'. This operation is non-portable and potentially unsafe.
              mime_typep(obj, (MimeObjectClass *) 
&mimeMultipartAppleDoubleClass))
                              ^^^^^^^^^^^^^^^^^^^                               
  
Warning 749: "mimei.cpp", line 975 # The cast from 'MimeObject *' to 
'MimeContainer *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
              MimeContainer *cont = (MimeContainer *) obj;
                                    ^^^^^^^^^^^^^^^^^     
Warning 749: "mimei.cpp", line 1305 # The cast from 'MimeInlineTextClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
              if (mime_typep(obj, (MimeObjectClass *) &mimeInlineTextClass))
                                  ^^^^^^^^^^^^^^^^^^^                       
Warning 749: "mimei.cpp", line 1306 # The cast from 'MimeObject *' to 
'MimeInlineText *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
                    charset = ((MimeInlineText *)obj)->charset;
                               ^^^^^^^^^^^^^^^^^^              


Warning 749: "mimeiimg.cpp", line 33 # The cast from 'MimeLeafClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
    MimeDefClass(MimeInlineImage, MimeInlineImageClass,
    ^^^^^^^^^^^^                                       
Warning 749: "mimeiimg.cpp", line 46 # The cast from 'MimeInlineImageClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      MimeObjectClass *oclass = (MimeObjectClass *) clazz;
                                ^^^^^^^^^^^^^^^^^^^       
Warning 749: "mimeiimg.cpp", line 47 # The cast from 'MimeInlineImageClass *' to 
'MimeLeafClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      MimeLeafClass   *lclass = (MimeLeafClass *) clazz;
                                ^^^^^^^^^^^^^^^^^       
Warning 749: "mimeiimg.cpp", line 64 # The cast from 'MimeLeafClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      return ((MimeObjectClass*)&MIME_SUPERCLASS)->initialize(object);
              ^^^^^^^^^^^^^^^^^^                                      
Warning 749: "mimeiimg.cpp", line 70 # The cast from 'MimeLeafClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      ((MimeObjectClass*)&MIME_SUPERCLASS)->finalize(object);
       ^^^^^^^^^^^^^^^^^^                                    
Warning 749: "mimeiimg.cpp", line 76 # The cast from 'MimeObject *' to 
'MimeInlineImage *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      MimeInlineImage *img = (MimeInlineImage *) obj;
                             ^^^^^^^^^^^^^^^^^^^     
Warning 749: "mimeiimg.cpp", line 81 # The cast from 'MimeLeafClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_begin(obj);
                ^^^^^^^^^^^^^^^^^^                                    
Warning 749: "mimeiimg.cpp", line 89 # The cast from 'MimeObjectClass *' to 
'MimeInlineImageClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      clazz = (MimeInlineImageClass *) obj->clazz;
              ^^^^^^^^^^^^^^^^^^^^^^^^            
Warning 749: "mimeiimg.cpp", line 149 # The cast from 'MimeObject *' to 
'MimeInlineImage *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      MimeInlineImage *img = (MimeInlineImage *) obj;
                             ^^^^^^^^^^^^^^^^^^^     
Warning 749: "mimeiimg.cpp", line 154 # The cast from 'MimeLeafClass *' to 
'MimeObjectClass *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_eof(obj, abort_p);
                ^^^^^^^^^^^^^^^^^^                                           
Warning 749: "mimeiimg.cpp", line 175 # The cast from 'MimeObject *' to 
'MimeInlineImage *' is performed as a 'reinterpret_cast'. This operation is 
non-portable and potentially unsafe.
      MimeInlineImage *img  = (MimeInlineImage *) obj;
                              ^^^^^^^^^^^^^^^^^^^     
and there are tons more ...

Comment 1

17 years ago
moving to future milestone.
Target Milestone: --- → Future

Updated

17 years ago
Status: NEW → ASSIGNED

Comment 2

17 years ago
reassigning to ducarroz
Assignee: rhp → ducarroz
Status: ASSIGNED → NEW

Updated

16 years ago
Status: NEW → ASSIGNED

Updated

15 years ago
QA Contact: lchiang → stephend
Product: MailNews → Core
Assignee: ducarroz → nobody
Status: ASSIGNED → NEW
QA Contact: stephend → mime
(Assignee)

Updated

9 years ago
Product: Core → MailNews Core
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.