checkedc / checkedc-clang

This repo contains a version of clang that is being modified to support Checked C. Checked C is an extension to C that lets programmers write C code that is guaranteed by the compiler to be type-safe.
https://www.checkedc.org
496 stars 72 forks source link

Fix non-deterministic output ordering in AvailableFactsAnalysis.cpp #756

Open mgrang opened 4 years ago

mgrang commented 4 years ago

AvailableFactsAnalysis.cpp uses std::set as the main data structure for storing/iterating the collected facts. The implementation of std::set is platform specific. That’s the reason the test test/CheckedC/dump-dataflow-facts.c fails on Windows (but passes on Linux). On Windows X64, there are run-to-run differences in the output order of blocks and facts when I run this test by hand.

The fix will involve rethinking about the data structures used and sorting before printing.

mgrang commented 4 years ago

Test marked unsupported for Windows in https://github.com/microsoft/checkedc-clang/pull/757.