When I look at the code and see that it uses
stdio function but has no
#include <cstdio>, I look no further. That’s a language violation, it shouldn’t work according to the language standard. So even if it happens to work for you for some reason, it’s an unsupported use case and Travis cannot guarantee that it’ll work.
As for the possible reason, https://stackoverflow.com/questions/57033333/what-implementation-of-getenv-is-used-if-no-header-is-included suggests that in some compiler versions, code with undefined functions might compile but crash at runtime. Maybe under some circumstances, the compiler can even link such a functon to some definition (e.g. if you do include this header in some other compilation unit). If this is the case, the compiler violates (relaxes) the language standard and as such, there’s no guarantee that other compilers or even other versions of the same compiler will work the same.
That’s exactly what standards are for: if you compily, you are officially guaranteed predictable behavior, and people will be fixing things if it’s not delivered. If you don’t, no-one guarantees you anything, any result (including errors and random behavior) is possible.