title: Is it possible to modify the "function call" at the preprocessing time or the compile time
body: <p><strong>1st problem:</strong> Is it possible to call a function with some parameters and it gets modify to something else after compilation either at preprocessing time or at compilation time into something like</p>
  
  <pre><code>#define func(a,b) func(a,sizeof(a),b)
  </code></pre>
  
  <p>Some may think why such a need arose.</p>
  
  <p>Actually I am porting code in windows using visual studio 2010 and there is some functions which are deprecated like strcpy(), strcat(), etc. It says to use strcpy_s() instead.</p>
  
  <p>I know I could have suppressed it using <code>#pragma disable(warning: )</code> or by providing flags like: </p>
  
  <pre><code>_CRT_NONSTDC_NO_DEPRRECATE
  _CRT_SECURE_NO_DEPRECATE
  _CRT_SECURE_NO_WARNINGS
  </code></pre>
  
  <p>But I don't wan't to ignore or suppress them.</p>
  
  <p>I tried to just simply replace the string instead of ignoring by using:</p>
  
  <pre><code>#define strcpy strcpy_s
  </code></pre>
  
  <p>as in here <a href="http://msdn.microsoft.com/en-us/library/td1esda9.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/td1esda9.aspx</a> I read there would be no mismatch of arguments if I don't provide the second arg.</p>
  
  <p>I mean it should be ok if I use like this:</p>
  
  <pre><code>#define strcpy strcpy_s
  strcpy(dest,src);
  </code></pre>
  
  <p>But its not. It still produce warning.</p>
  
  <p><strong>Definition of strcpy_s is:</strong></p>
  
  <pre><code>errno_t strcpy_s(
     char *strDestination,
     size_t numberOfElements,
     const char *strSource 
  );
  </code></pre>
  
  <p><strong>2nd problem:</strong> The first argument is a pointer to a dynamically allocated memory so how can I get the size of the memory pointed by this pointer. Though I read that it's not feasible but there has to be some way(hopefully). </p>
  
  <p>By the way what is <code>_countof(var)</code>?</p>