[vtk-developers] Recent change to vtkTexture.h adds compiler warnings

Jeff Baumes jeff.baumes at kitware.com
Thu Jun 26 13:44:36 EDT 2008

I would suggest removing the enum name.


---------- Forwarded message ----------
From: Sean McBride <sean at rogue-research.com>
Date: Thu, Jun 26, 2008 at 1:08 PM
Subject: [vtk-developers] Recent change to vtkTexture.h adds compiler warnings
To: vtk-developers at vtk.org

Hi all,

Some warning flags produce far too many warnings with VTK's code but
cause no problems for VTK's public headers.  For this reason, we're able
to enable more warnings in our app than with our dashboards.  Up until
very recently we were warning-free.

This change:

has introduced the warning (from gcc's -Wsign-promo):

vtkTexture.h:171: warning: passing 'VTKTextureBlendingMode' chooses
'int' over 'unsigned int'
vtkTexture.h:171: warning:   in call to 'vtkOStreamWrapper&
vtkTexture.h: In member function 'virtual void

This was added:

typedef enum
} VTKTextureBlendingMode;

The compiler gets to decide the type and size of enums, which I guess is
the root of the problem.  One fix would be:

typedef int VTKTextureBlendingMode;

What are the coding standards in this situation?  VTK actually seems to
almost never give a name to enums (I found only 2 others) so another
option would be to remove 'VTKTextureBlendingMode' entirely and use
'int' in place.

Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada

vtk-developers mailing list
vtk-developers at vtk.org

Jeff Baumes, Ph.D.
R&D Engineer, Kitware Inc.
(518) 371-3971 x132
jeff.baumes at kitware.com

More information about the vtk-developers mailing list