bug-m4
[Top][All Lists]
Advanced

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

Re: M4 1.4.9b testsuite failure


From: Andreas Schwab
Subject: Re: M4 1.4.9b testsuite failure
Date: Sun, 03 Jun 2007 11:35:49 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.97 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Andreas Schwab wrote about IA-64 Pseudo-NaNs:
>> It's definitely not a valid encoding.
>
> [1] calls it an "unsupported" encoding.

Don't mix the ia64 fpu register encoding with the i387 extended real
encoding.  They are unrelated.

Read the ia32 manual: "The Intel 387 math coprocessor and later IA-32
processors generate the invalid-operation exception when they are
encountered as operands."  That's what is called a trap representation.

> So it comes down to a "quality of implementation" issue. Should 'printf'
> be garbage-in - garbage-out?

You are using a trap encoding.  That is invoking undefined behaviour.
Don't do that.

> Why does printf("%s", NULL) print "(null)" instead of crashing with a
> SIGSEGV?

You are invoking undefined behaviour.  Don't do that.

> Because printf is often used for debugging, and a printf that
> does not show what the values _really_ are is not helpful in such cases.

If you are debugging you definitely not try to print the cooked value,
but use an unsigned char array.  That is the only way to get defined
behaviour.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]