# HG changeset patch # User Edouard Tisserant # Date 1712316233 -7200 # Node ID f3c6c938d5ffa50b7adcbb1e1e72afa08d05d627 # Parent f7cc4f6ce756ac9153830e952eddcecd0d14a6a6# Parent 1610b6528b27de90a84a28619a87fe31d397206d merge diff -r f7cc4f6ce756 -r f3c6c938d5ff .gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.gitignore Fri Apr 05 13:23:53 2024 +0200 @@ -0,0 +1,15 @@ +aclocal.m4 +config.log +config.status +configure +iec2c +iec2iec +*.o +**/Makefile +**/Makefile.in +*.Po +*.a +autom4te.cache/* +config/* +stage1_2/*.cc +stage1_2/*.hh \ No newline at end of file diff -r f7cc4f6ce756 -r f3c6c938d5ff absyntax_utils/debug_ast.cc --- a/absyntax_utils/debug_ast.cc Fri Apr 05 12:05:28 2024 +0200 +++ b/absyntax_utils/debug_ast.cc Fri Apr 05 13:23:53 2024 +0200 @@ -56,12 +56,12 @@ else if (const_value._real64.is_nonconst()) fprintf(stderr, "nc"); else fprintf(stderr, "?"); fprintf(stderr, ", i="); - if (const_value. _int64.is_valid ()) fprintf(stderr, "%"PRId64"", const_value. _int64.get()); + if (const_value. _int64.is_valid ()) fprintf(stderr, "%" PRId64 "", const_value. _int64.get()); else if (const_value. _int64.is_overflow()) fprintf(stderr, "ov"); else if (const_value. _int64.is_nonconst()) fprintf(stderr, "nc"); else fprintf(stderr, "?"); fprintf(stderr, ", u="); - if (const_value._uint64.is_valid ()) fprintf(stderr, "%"PRIu64"", const_value._uint64.get()); + if (const_value._uint64.is_valid ()) fprintf(stderr, "%" PRIu64 "", const_value._uint64.get()); else if (const_value._uint64.is_overflow()) fprintf(stderr, "ov"); else if (const_value._uint64.is_nonconst()) fprintf(stderr, "nc"); else fprintf(stderr, "?"); diff -r f7cc4f6ce756 -r f3c6c938d5ff stage3/array_range_check.cc --- a/stage3/array_range_check.cc Fri Apr 05 12:05:28 2024 +0200 +++ b/stage3/array_range_check.cc Fri Apr 05 13:23:53 2024 +0200 @@ -135,36 +135,36 @@ /* Check lower limit */ if ( VALID_CVALUE( int64, l->get_element(i)) && VALID_CVALUE( int64, dimension->lower_limit)) if ( GET_CVALUE( int64, l->get_element(i)) < GET_CVALUE( int64, dimension->lower_limit) ) - {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be >= %"PRId64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE( int64, dimension->lower_limit)); continue;} + {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %" PRId64 ", should be >= %" PRId64 ").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE( int64, dimension->lower_limit)); continue;} if ( VALID_CVALUE( int64, l->get_element(i)) && VALID_CVALUE(uint64, dimension->lower_limit)) if ( cmp_unsigned_signed( GET_CVALUE(uint64, dimension->lower_limit), GET_CVALUE( int64, l->get_element(i))) > 0 ) - {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be >= %"PRIu64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE(uint64, dimension->lower_limit)); continue;} + {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %" PRId64 ", should be >= %" PRIu64 ").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE(uint64, dimension->lower_limit)); continue;} if ( VALID_CVALUE(uint64, l->get_element(i)) && VALID_CVALUE(uint64, dimension->lower_limit)) if ( GET_CVALUE(uint64, l->get_element(i)) < GET_CVALUE(uint64, dimension->lower_limit)) - {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be >= %"PRIu64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE(uint64, dimension->lower_limit)); continue;} + {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %" PRIu64 ", should be >= %" PRIu64 ").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE(uint64, dimension->lower_limit)); continue;} if ( VALID_CVALUE(uint64, l->get_element(i)) && VALID_CVALUE( int64, dimension->lower_limit)) if ( cmp_unsigned_signed(GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE( int64, dimension->lower_limit)) < 0 ) - {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be >= %"PRId64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE( int64, dimension->lower_limit)); continue;} + {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %" PRIu64 ", should be >= %" PRId64 ").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE( int64, dimension->lower_limit)); continue;} /* Repeat the same check, now for upper limit */ if ( VALID_CVALUE( int64, l->get_element(i)) && VALID_CVALUE( int64, dimension->upper_limit)) if ( GET_CVALUE( int64, l->get_element(i)) > GET_CVALUE( int64, dimension->upper_limit)) - {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be <= %"PRId64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE( int64, dimension->upper_limit)); continue;} + {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %" PRId64 ", should be <= %" PRId64 ").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE( int64, dimension->upper_limit)); continue;} if ( VALID_CVALUE( int64, l->get_element(i)) && VALID_CVALUE(uint64, dimension->upper_limit)) if ( cmp_unsigned_signed( GET_CVALUE(uint64, dimension->upper_limit), GET_CVALUE( int64, l->get_element(i))) < 0 ) - {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be <= %"PRIu64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE(uint64, dimension->upper_limit)); continue;} + {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %" PRId64 ", should be <= %" PRIu64 ").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE(uint64, dimension->upper_limit)); continue;} if ( VALID_CVALUE(uint64, l->get_element(i)) && VALID_CVALUE(uint64, dimension->upper_limit)) if ( GET_CVALUE(uint64, l->get_element(i)) > GET_CVALUE(uint64, dimension->upper_limit)) - {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be <= %"PRIu64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE(uint64, dimension->upper_limit)); continue;} + {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %" PRIu64 ", should be <= %" PRIu64 ").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE(uint64, dimension->upper_limit)); continue;} if ( VALID_CVALUE(uint64, l->get_element(i)) && VALID_CVALUE( int64, dimension->upper_limit)) if ( cmp_unsigned_signed(GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE( int64, dimension->upper_limit)) > 0 ) - {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be <= %"PRId64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE( int64, dimension->upper_limit)); continue;} + {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %" PRIu64 ", should be <= %" PRId64 ").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE( int64, dimension->upper_limit)); continue;} } } @@ -199,7 +199,7 @@ // remember that the result (dimension) is unsigned, while the operands are signed!! // dimension = GET_CVALUE( int64, symbol->upper_limit) - VALID_CVALUE( int64, symbol->lower_limit); if (GET_CVALUE( int64, symbol->lower_limit) > GET_CVALUE( int64, symbol->upper_limit)) { - STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%"PRId64") larger than upper limit (%"PRId64").", GET_CVALUE( int64, symbol->lower_limit), GET_CVALUE( int64, symbol->upper_limit)); + STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%" PRId64 ") larger than upper limit (%" PRId64 ").", GET_CVALUE( int64, symbol->lower_limit), GET_CVALUE( int64, symbol->upper_limit)); dimension = std::numeric_limits< unsigned long long int >::max() - 1; // -1 because it will be incremented at the end of this function!! } else if (GET_CVALUE( int64, symbol->lower_limit) >= 0) { dimension = GET_CVALUE( int64, symbol->upper_limit) - GET_CVALUE( int64, symbol->lower_limit); @@ -209,7 +209,7 @@ } } else if (VALID_CVALUE(uint64, symbol->upper_limit) && VALID_CVALUE(uint64, symbol->lower_limit)) { if (GET_CVALUE(uint64, symbol->lower_limit) > GET_CVALUE(uint64, symbol->upper_limit)) { - STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%"PRIu64") larger than upper limit (%"PRIu64").", GET_CVALUE(uint64, symbol->lower_limit), GET_CVALUE(uint64, symbol->upper_limit)); + STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%" PRIu64 ") larger than upper limit (%" PRIu64 ").", GET_CVALUE(uint64, symbol->lower_limit), GET_CVALUE(uint64, symbol->upper_limit)); dimension = std::numeric_limits< unsigned long long int >::max() - 1; // -1 because it will be incremented at the end of this function!! } else dimension = GET_CVALUE(uint64, symbol->upper_limit) - GET_CVALUE(uint64, symbol->lower_limit);