title: To which degree does the C preprocessor regard integer literal suffixes?
body: <p>Today, I stumbled over something like this:</p>
  
  <pre class="lang-c prettyprint-override"><code>#define FOO 2u
  
  #if (FOO == 2)
    unsigned int foo = FOO;
  #endif
  </code></pre>
  
  <p>Regardless of why the code is as it is (let's not question the <code>why</code>), I was wondering to which degree the preprocessor can even handle integer literal suffixes. I was actually surprised that it works at all.
  After doing some experiments with <a href="https://www.tutorialspoint.com/compile_c99_online.php" rel="noreferrer">GCC and C99</a> with this code ...</p>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  
  int main()
  {
    #if (1u == 1)
      printf("1u == 1\n");
    #endif
  
    #if (1u + 1l == 2ll)
      printf("1u + 1l == 2ll\n");
    #endif
  
    #if (1ull - 2u == -1)
      printf("1ull - 2u == -1\n");
    #endif
  
    #if (1u - 2u == 0xFFFFFFFFFFFFFFFF)
      printf("1u - 2u == 0xFFFFFFFFFFFFFFFF\n");
    #endif
  
    #if (-1 == 0xFFFFFFFFFFFFFFFF)
      printf("-1 == 0xFFFFFFFFFFFFFFFF\n");
    #endif
  
    #if (-1l == 0xFFFFFFFFFFFFFFFF)
      printf("-1l == 0xFFFFFFFFFFFFFFFF\n");
    #endif
  
    #if (-1ll == 0xFFFFFFFFFFFFFFFF)
      printf("-1ll == 0xFFFFFFFFFFFFFFFF\n");
    #endif
  }
  </code></pre>
  
  <p>... which just prints all the statements:</p>
  
  <pre><code>1u == 1
  1u + 1l == 2ll
  1ull - 2u == -1
  1u - 2u == 0xFFFFFFFFFFFFFFFF
  -1 == 0xFFFFFFFFFFFFFFFF
  -1l == 0xFFFFFFFFFFFFFFFF
  -1ll == 0xFFFFFFFFFFFFFFFF
  </code></pre>
  
  <p>... I guess the preprocessor simply ignores integer literal suffixes altogether and probably always does arithmetics and comparisons in the native integer size, in this case 64 bit?</p>
  
  <h3>So, here is the stuff I'd like to know:</h3>
  
  <ol>
  <li>To which degree does the preprocessor regard integer literal suffixes? Or does it just ignore them?</li>
  <li>Are there any dependencies or different behaviors with different environments, e.g. different compilers, C vs. C++, 32 bit vs. 64 bit machine, etc.? I.e., what does the preprocessor's behavior depend on?</li>
  <li>Where is all that specified/documented?</li>
  </ol>
  
  <p>I wanted to find out by myself and checked out
  <a href="https://en.wikipedia.org/wiki/C_preprocessor" rel="noreferrer">Wikipedia</a> and <a href="http://www.open-std.org/JTC1/SC22/WG14/www/standards" rel="noreferrer">the C standard (working paper)</a>. I found information about integer suffixes and information about the preprocessor, but none about the combination of these. Obviously, I have also googled it but didn't get any useful results.</p>
  
  <p>I have seen <a href="https://stackoverflow.com/questions/34514612/standards-for-the-c-and-or-c-preprocessors">this Stack&nbsp;Overflow question</a> that clarifies where it <em>should</em> be specified, but yet, I couldn't find an answer for my questions.</p>