<div dir="ltr">Try int&#39;s. See:<br><a href="http://www.stroustrup.com/C++11FAQ.html#narrowing">http://www.stroustrup.com/C++11FAQ.html#narrowing</a><br><br>const char  buffer[3] = { 255, 255, 254};<br><br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sat, May 18, 2013 at 1:09 PM, Bradley Lowekamp <span dir="ltr">&lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
I pushed some code yesterday and it&#39;s causing a couple problem. It seems simple enough. Whats the best way to express this?<br>
<br>
   // MAGIC_NUMBER = 16777214 ( little endian )<br>
   const char  buffer[3] = { 0xFF, 0xFF, 0xFE};<br>
<br>
<br>
ERROR:<br>
/Users/builder/external/ITK/Modules/IO/Mesh/src/itkFreeSurferBinaryMeshIO.cxx:311:31: error: constant expression evaluates to 255 which cannot be narrowed to type &#39;char&#39; [-Wc++11-narrowing]<br>
   const char  buffer[3] = { 0xFF, 0xFF, 0xFE};<br>
                             ^~~~<br>
/Users/builder/external/ITK/Modules/IO/Mesh/src/itkFreeSurferBinaryMeshIO.cxx:311:31: note: override this message by inserting an explicit cast<br>
   const char  buffer[3] = { 0xFF, 0xFF, 0xFE};<br>
                             ^~~~<br>
                             static_cast&lt;char&gt;( )<br>
<br>
<br>
WARNING:<br>
<br>
var/lib/jenkins/jobs/ITK-v4-Testing-32-chroot/workspace/MyTests/ITK/Modules/IO/Mesh/src/itkFreeSurferBinaryMeshIO.cxx: In member function &#39;virtual void itk::FreeSurferBinaryMeshIO::WriteMeshInformation()&#39;:<br>
/var/lib/jenkins/jobs/ITK-v4-Testing-32-chroot/workspace/MyTests/ITK/Modules/IO/Mesh/src/itkFreeSurferBinaryMeshIO.cxx:311:47: warning: narrowing conversion of &#39;255&#39; from &#39;int&#39; to &#39;const char&#39; inside { } is ill-formed in C++11 [-Wnarrowing]<br>

<br>
<br>
Thanks for your suggestion.<br>
<br>
Brad<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>