From e7b077d9759ad0ea2048d2ef3675b73c24787185 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 2 Jun 2004 02:29:44 +0000 Subject: [PATCH] warning instead of abort SVN revision: 10413 --- legacy/embryo/src/bin/embryo_cc_sc2.c | 29 +++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/legacy/embryo/src/bin/embryo_cc_sc2.c b/legacy/embryo/src/bin/embryo_cc_sc2.c index af47791e8f..0a6154870e 100644 --- a/legacy/embryo/src/bin/embryo_cc_sc2.c +++ b/legacy/embryo/src/bin/embryo_cc_sc2.c @@ -640,8 +640,33 @@ ftoi(cell * val, char *curptr) { float test1 = 0.0, test2 = 50.0; - assert(*(int *)&test1 == 0x00000000L - && *(int *)&test2 == 0x42480000L); + if (*(int *)&test1 != 0x00000000L) + { + fprintf(stderr, + "embryo_cc: WARNING! you compiler does not SEEM to interpret IEEE floating\n" + "point math as embryo expects. this could be bad.\n" + "\n" + "(float 0.0 != 0x00000000 bitpattern, 0x%08x instead)\n" + "\n" + "this could be an issue with you compiling embryo with gcc 3.2.x that seems\n" + "to trigger this sanity check. we are not sure why yet, but gcc 3.3.x works\n" + , (int)(*(int *)&test1) + ); + } + else if ((int *)&test2 != 0x42480000L) + { + fprintf(stderr, + "embryo_cc: WARNING! you compiler does not SEEM to interpret IEEE floating\n" + "point math as embryo expects. This could be bad.\n" + "\n" + "(float 50.0 != 0x42480000 bitpattern, 0x%08x instead)\n" + "\n" + "this could be an issue with you compiling embryo with gcc 3.2.x that seems\n" + "to trigger this sanity check. we are not sure why yet, but gcc 3.3.x works\n" + , (int)(*(int *)&test2) + ); + } + } #endif }