[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [csmith-dev] Floating-point support in csmith
The premise I am trying to keep is that giving the same seed, Csmith should generate the exactly same random C program no matter on which platform it is running. C is a portable language, so should be Csmith as a portable tool.
From: Xuejun Yang
Sent: Friday, November 13, 2015 1:47 PM
To: 'Eric Eide' <email@example.com>; Csmith Dev Mailing List <firstname.lastname@example.org>
Subject: RE: [csmith-dev] Floating-point support in csmith
As long as the change doesn't mandate a boost library, I can make it build on windows. Visual Studio has a notion of "PreprocessorDefinitions", located in csmith.vcxproj, that where we should set windows-specific definitions.
A more generic question is why do we want to take a dependency on a non-platform-neutral package? Can we duplicate the source code in Csmith itself, if the license permits? I know there will be argument about keeping the code in sync. But if we anticipate the code we depend on is relatively stable, we can save a lot of hassles on packaging and distribution by duplicating the code.
Take a look of lrand48.c and srand48.c under Csmith/runtime/windows. Windows does not support lrand48 and srand48. I ended up copying the source code from Martin Birgmeier.
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of Eric Eide
Sent: Friday, November 13, 2015 12:17 PM
To: Csmith Dev Mailing List <email@example.com>
Subject: Re: [csmith-dev] Floating-point support in csmith
Xuejun Yang <firstname.lastname@example.org> writes:
> I have a question about optional-Boost: Is it going to break the build
> on windows?
Well, since it's not implemented yet, I can't say :-)!
More generally: I'm not set up to try a VS-based build. I will need your help to make sure that things don't break.
In C++ code, I expect that an optional-Boost-based would work by defining a preprocessor symbol like `HAVE_BOOST', which is unset or zero when the Boost-based features are not selected. The easiest way not to break a Windows build would be to simply not set the symbol --- at the cost of not being able to activate the feature, of course!
I don't know how to do an optional compile-time feature in VS. If we are interested in this, then I'll need your help.
Eric Eide <email@example.com> . University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX