[PATCH] Fix PR c/12446

Gabriel Dos Reis gdr@integrable-solutions.net
Fri Oct 3 21:44:00 GMT 2003


"Joseph S. Myers" <jsm@polyomino.org.uk> writes:

| On Fri, 3 Oct 2003, Gabriel Dos Reis wrote:
| 
| > In an assignment, the right-hand-side expression is *converted* to the
| > type of the left-hand-side expression.  In this case, that means
| > decaying the array, which is undefined behaviour.  It is not an issue
| > of assigning values of incompatible types.
| 
| It is converted, subject to *constraints* (i.e., diagnostic required for
| violation) on the types of the operands.  The listed possibilities for the
| types of the operands in assignment do not include array types, so there
| is a constraint violation and a diagnostic is required.  (Whether there
| might *also* be undefined behavior is irrelevant, as C90 TC1 made it
| explicit that constraint violations require diagnostics even if there is
| undefined behavior as well.)

OK.

-- Gaby



More information about the Gcc-patches mailing list