title: What happens if you declare a variable inside a macro?
body: <p>Suppose I have a macro defined as this:</p>
  
  <pre>
  #define FOO(x,y) \
  do {
    int a,b;
    a = f(x);
    b = g(x);
    y = a+b;
  } while (0)
  </pre>
  
  <p>When expanding the macro, does GCC "guarantee" any sort of uniqueness to a,b?  I mean in the sense that if I use FOO in the following manner:</p>
  
  <pre>
  int a = 1, b = 2;
  FOO(a,b);
  </pre>
  
  <p>After, preprocessing this will be:</p>
  
  <pre>
  int a = 1, b = 2;
  do {
    int a,b;
    a = f(a);
    b = g(b);
    b = a+b;
  } while (0)
  </pre>
  
  <p>Can/will the compiler distinguish between the <code>a</code> outside the do{} and the <code>a</code> inside the do?  What tricks can I use to guarantee any sort of uniqueness (besides making the variables inside have a garbled name that makes it unlikely that someone else will use the same name)?</p>
  
  <p>(Ideally functions would be more useful for this, but my particular circumstance doesn't permit that)</p>