Is there anything OS-dependent about gcc that would cause a meaningful change between the two versions? Are the two versions even different? Just want to make sure, because I test my code on onlinegdb but paranoidly compile and check it on my school's CentOS server before I submit. I'm wondering if this necessary.

2 Answers 2


Agree with @fox, but additionally there are platform dependent behaviour, and undefined behaviour (GCC tried to define these where it can). These may differ by platform OS and hardware. However Gcc will try to keep things consistent (where it can).

An example of differences, will be the size of the long int and size_t data types may be 32 bit or 64 bit. (on other compilers them may also be 8 bit or 16 bit).


The site you mention is currently using GCC 5, while CentOS seems to use at least GCC 7. But this is why we have standards. Valid C99 code will compile on either platform just fine. It'll run the same (though possibly faster or slower) unless you're doing something like using platform-specific libraries or "incorrectly" serializing structures without caring about endianness (if the host architectures differ)

tl;dr: for things you'd be doing for school, it's unlikely the differences would be meaningful

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .