Multiplatform development configuration

I’ve recently have one problem with regular expression, my program is working on Mac but not in Linux. After digging a bit, I’ve found what causes this. Same code, different behaviour between Linux and Mac

I was wondering if there is a rule of thumb developing OF application on xcode and porting them later to linux(or the opposite), which c++ compiler to use, which flags to enable, ecc…