MantisBT - ITK | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0004618 | ITK | public | 2007-03-16 11:24 | 2010-10-21 12:31 | |
| Reporter | Mathieu Coursolle | ||||
| Assigned To | Luis Ibanez | ||||
| Priority | low | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | OS | OS Version | |||
| Product Version | |||||
| Target Version | Fixed in Version | ||||
| Resolution Date | |||||
| Sprint | |||||
| Sprint Status | |||||
| Summary | 0004618: itkDebugMacro causes warning in XCode with enum types. | ||||
| Description | When including itk headers in a XCode project, the itkSetMacro, itkGetMacro, itkGetConstMacro and itkGetConstReferenceMacro produce a warning when the input type is an enum: /include/InsightToolkit/IO/itkImageIOBase.h: In member function 'virtual void itk::ImageIOBase::SetPixelType(itk::ImageIOBase::IOPixelType)': /include/InsightToolkit/IO/itkImageIOBase.h:136: warning: passing 'itk::ImageIOBase::IOPixelType' chooses 'int' over 'long unsigned int' /include/InsightToolkit/IO/itkImageIOBase.h:136: warning: in call to 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits<char>]' A patch is provide which solves the problem for the IO classes. New macro were added to handle enum types: itkSetEnumMacro, etc. The enum type is there casted into a long value to force the type. Another proposed solution would be to force the enum type at declaration: Replace typedef enum{TYPE1, TYPE2} MyEnum; with enum { TYPE1, TYPE2} typedef long MyEnum; This forces the enum type. Otherwise, the enum type might be considered as a different type according to the platform it is used on. This is mainly true for 64 bits platforms. | ||||
| Steps To Reproduce | |||||
| Additional Information | |||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | https://public.kitware.com/Bug/file/944/patchfileEnums.txt https://public.kitware.com/Bug/file/2087/patch.txt | ||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2009-03-02 12:35 | Mathieu Coursolle | Note Added: 0015493 | |||
| 2009-03-02 12:35 | Mathieu Coursolle | Status | closed => feedback | ||
| 2009-03-02 12:35 | Mathieu Coursolle | Resolution | fixed => reopened | ||
| 2009-03-02 12:36 | Mathieu Coursolle | File Added: patch.txt | |||
| 2009-03-02 12:37 | Mathieu Coursolle | Note Added: 0015494 | |||
| 2009-06-04 10:14 | Sean McBride | Note Added: 0016635 | |||
| 2009-06-05 12:06 | Sean McBride | Note Added: 0016646 | |||
| 2009-06-05 12:06 | Sean McBride | Status | feedback => resolved | ||
| 2009-06-05 12:06 | Sean McBride | Resolution | reopened => fixed | ||
| 2010-10-21 12:31 | Gabe Hart | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||