title: Why is it difficult to write portable C programs?
body: <p>I want to know, why is it too hard to make a program run in many OSes, like Windows and Linux, without including glue code. They all share the same architecture (x86), so I think it should be simple. Furthermore, C is standardized, so why are implementations diferent in these OSes? Why is it hard to follow the standard and implement a universal library for all OSes?</p>
  <p>I have programmed in C for almost two years, and currently I use glib for portability.</p>
  <p>I'm not looking for a solution to this problem, I'm already using glib for this purpose. But I want to know why it is necessary, why it's dificult to make a C library without differences.</p>
  <p>[ADD]</p>
  <p>For example, when i write a program in C/Glib, i use the gchar/gint and so on types indeed the C primitive types, in wikipedia about glib, it says that : <br /></p>
  <blockquote>
  <p>&quot;Features</p>
  <p>On an elementary level GLib provides type definitions replacing the C primitive types char, int, float, and so on in order to improve portability&quot;</p>
  </blockquote>
  <p>Why C primitive types is not portable and the whole language?</p>
  <p>Thanks for all the answers.</p>