title: compiling source code on 2 different versions of gcc
body: <p>I am compiling my source code on 2 different machines that use different versions of gcc.</p>
  
  <p>cflags c89</p>
  
  <pre><code>-Wall -Wextra -Wunreachable-code -g -m32 -D_DEBUG -O0 -D_LARGEFILE64_SOURCE -D_REETRANT -D_THREAD_SAFE
  </code></pre>
  
  <p>One is redhat-4</p>
  
  <pre><code>gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)
  Linux 203_test_server 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
  </code></pre>
  
  <p>And one is Fedora 18</p>
  
  <pre><code>gcc (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8)
  Linux localhost.localdomain 3.8.1-201.fc18.x86_64 #1 SMP Thu Feb 28 19:23:08 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
  </code></pre>
  
  <p>My fedora 18 compiles with no errors. However, on the redhat 4 machine I get some errors. </p>
  
  <pre><code>channel.h:35: error: redefinition of typedef ‘channel_t’
  internal.h:19: error: previous declaration of ‘channel_t’ was here
  </code></pre>
  
  <p>I think the error is just a circular problem. However, with the same code base would compiling on 2 different machines really make a difference using 2 different versions of gcc?</p>
  
  <p>I was thinking using a newer version of a compiler will generate more errors, as the newer compiler might be more strict.</p>
  
  <p><strong>This is not a question to solve the error, but a general question on compilers.</strong></p>
  
  <p>Is there any flags I can set to avoid this in the future. Maybe if compiling on this version of gcc do this, if the versions are not compatible?</p>