title: conversion to ‘size_t’ from ‘int’ may change the sign of the result - GCC , C
body: <p>In my project I have turned on treat warnings as errors and compiling using the <code>-pedantic</code> and <code>-ansi</code> tags. I am using GCC compiler. In this project I have to use a third party source code which has got lot of warnings. Since I treat warnings as errors, I am having a tough time in fixing their code. </p>
  
  <p>Most of the warnings are about invalid conversion from <code>int</code> to <code>size_t</code> or viceversa. In some cases, I won't be able to make both the variables same type, I mean I won't be able to change something to <code>size_t</code>. In such cases I am doing an explicit cast. Something like,</p>
  
  <pre><code>size_t a = (size_t) atoi(val);
  </code></pre>
  
  <p>I am wondering is this the correct approach? Is there any problem in doing cast like this? </p>
  
  <p>If these warnings are minor, can I suppress it only on their files? How do I do the same on MSVC?</p>