From 66a3111ca9c87d7b8bbf463c2810de951aa686d7 Mon Sep 17 00:00:00 2001 From: degomme Date: Tue, 2 Aug 2016 14:05:14 +0200 Subject: [PATCH] Add a check to crash when user is compiling with stable version, and linking with dev version. Or the other way around. We allow compatibility (with a warning) between 3.xx.yy and 3.xx.zz, but patch num 90+ is for dev version, which could be completely incompatible and should not be expected to work. --- src/surf/surf_interface.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 8213e7b9cc..daee1ea827 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -251,6 +251,15 @@ void sg_version_check(int lib_version_major,int lib_version_minor,int lib_versio abort(); } if (lib_version_patch != SIMGRID_VERSION_PATCH) { + if(SIMGRID_VERSION_PATCH >= 90 || lib_version_patch >=90){ + fprintf(stderr, + "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, " + "and then linked against SimGrid %d.%d.%d. \n" + "One of them is a development version, and should not be mixed with the stable release. Please fix this.\n", + lib_version_major,lib_version_minor,lib_version_patch, + SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH); + abort(); + } fprintf(stderr, "Warning: Your program was compiled with SimGrid version %d.%d.%d, " "and then linked against SimGrid %d.%d.%d. Proceeding anyway.\n", -- 2.20.1