<div class="gmail_quote">On 19 August 2012 15:04, Xiaofeng Z <span dir="ltr">&lt;<a href="mailto:xf10036@outlook.com" target="_blank">xf10036@outlook.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div><div dir="ltr">The author says the comma was intentional.  Obviously it&#39;s not simply about the time it takes to remove it.  I can see a good reason why the comma is there.</div></div></blockquote><div dir="ltr">
   </div><div>What is the good reason?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="ltr">My approach is typically to end a enum with like, for this case, AlignInvalid=0xFFFF.<br>
<br>Xiaofeng Zhao<br><br><br><div><div></div><hr>Date: Sat, 18 Aug 2012 03:38:03 +0000<br>From: <a href="mailto:trevorirons@gmail.com" target="_blank">trevorirons@gmail.com</a><br>To: <a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a><br>
CC: <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>Subject: Re: [vtkusers] small bug report, extra comma in enum<div><div class="h5"><br><br>arguably the email was more work... <br><br>I know it&#39;s now a big deal, but I like compiling with pedantic and I&#39;m always hit with this. Although it&#39;s the *only* warning I see (though not very comprehensive coverage) in VTK. So good on all the VTK developers. Thanks.<br>

<br clear="all">-- Trevor<br><br>
<br><br><div>On 18 August 2012 03:29, David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>&gt;</span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex">

<div><div>On Fri, Aug 17, 2012 at 8:23 PM, John Drescher &lt;<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>&gt; wrote:<br>
&gt; On Fri, Aug 17, 2012 at 10:19 PM, Trevor Irons &lt;<a href="mailto:trevorirons@gmail.com" target="_blank">trevorirons@gmail.com</a>&gt; wrote:<br>
&gt;&gt; When I compile using gcc on pedantic I&#39;ve been bothered by a warning for<br>
&gt;&gt; years. Was hoping someone with commit access could spend about 12 seconds<br>
&gt;&gt; and fix this.<br>
&gt;&gt;<br>
&gt;&gt; The warning reads<br>
&gt;&gt; In file included from external/matplot/matplot.h:40:0,<br>
&gt;&gt;                  from<br>
&gt;&gt; /home/tirons/src/Merlin/include/snmrinversion1damp.h:45,<br>
&gt;&gt;                  from<br>
&gt;&gt; /home/tirons/src/Merlin/unittest/utsnmrinversion1dgmrsimul.cpp:40:<br>
&gt;&gt; /usr/local/include/vtk-6.0/vtkXYPlotActor.h:395:28: warning: comma at end of<br>
&gt;&gt; enumerator list [-pedantic]<br>
&gt;&gt;<br>
&gt;&gt; In vtkXYPlotActor.h line 395 there is an extra comma :<br>
&gt;&gt;<br>
&gt;&gt; enum Alignment {<br>
&gt;&gt;   AlignLeft = 0x1,<br>
&gt;&gt;   AlignRight = 0x2,<br>
&gt;&gt;   AlignHCenter = 0x4,<br>
&gt;&gt;   AlignTop = 0x10,<br>
&gt;&gt;   AlignBottom = 0x20,<br>
&gt;&gt;   AlignVCenter = 0x40,<br>
&gt;&gt;   AlignAxisLeft = 0x100,<br>
&gt;&gt;   AlignAxisRight = 0x200,<br>
&gt;&gt;   AlignAxisHCenter = 0x400,<br>
&gt;&gt;   AlignAxisTop = 0x1000,<br>
&gt;&gt;   AlignAxisBottom = 0x2000,<br>
&gt;&gt;   AlignAxisVCenter = 0x4000,         &lt;-- Extra comma right here<br>
&gt;&gt; };<br>
&gt;&gt;<br>
&gt;&gt; I would really appreciate it if someone with commit privileges could remove<br>
&gt;&gt; this.<br>
&gt;&gt;<br>
&gt;<br>
&gt; Isn&#39;t that legal in c++? I intentionally make my enums that way..<br>
<br>
</div></div>It was illegal until C++11, though compilers have been lax about it.<br>
So, yes, the extra comma should be removed but I&#39;ve already<br>
spent more than 12 seconds just typing this email...<br>
<br>
Trailing commas in initializer lists have always been legal, though.<br>
<span><font color="#888888"><br>
 - David<br>
</font></span></blockquote></div><br>
<br></div></div>_______________________________________________
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>

Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a></div>                                               </div></div>
</blockquote></div><br>