[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [csmith-bugs] unsigned int literals and --ccomp



Hi Xavier,

On 7/31/11 10:05 AM, Xavier Leroy wrote:
But I'm dying to know: why is it that with --ccomp Csmith omits the U
suffix?  Did you find a problem in CompCert that this would trigger?
Please tell me!

No. I didn't find any case where CompCert have a problem to deal with the U suffix.

I browsed your sources to try to answer my question, and instead came
up with one more question:

In src/Constant.cpp, line 276:

		    if (CGOptions::ccomp())
		    	v = oss.str();
		    else
			v = oss.str() + (type->is_signed() ? "L" : "U");

"U" means "unsigned", but "L" doesn't mean "signed", it means "long".
I would have expected either

			v = oss.str() + (type->is_signed() ? "L" : "UL");

if you really want to force all constants to be long (really?), or

			v = oss.str() + (type->is_signed() ? "" : "U");

if you don't.


It's my ugly mistake. I will fix it soon. Sorry for the confusion!

- Yang