Re: int pointing to char
From: Dan Pop (Dan.Pop_at_cern.ch)
Date: 03/10/04
- Next message: Guillaume: "Re: What are the difference among them?"
- Previous message: Kevin Bracey: "Re: c89 and c99"
- In reply to: Jeremy Yallop: "Re: int pointing to char"
- Next in thread: Dan Pop: "Re: int pointing to char"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 10 Mar 2004 15:23:01 GMT
In <slrnc4tnrg.4mn.jeremy@maka.cl.cam.ac.uk> Jeremy Yallop <jeremy@jdyallop.freeserve.co.uk> writes:
>James Hu wrote:
>> However, I honestly believe that applying semantics to code that has
>> constraint violations is enough to determine if the code is erroneous
>> or not. The constraint violation alone does not have render the
>> code erroneous.
>
>This is a mistake. The language clauses of the standard are arranged
>into syntax/constraints/semantics groupings. The order is relevant:
>the meaning is "code with this syntax, subject to these constraints,
>has these semantics". If the syntax does not match then the
>constraints are irrelevant. If the syntax matches but the constraints
>are not satisfied then the semantics don't apply to the code.
It's interesting to note that, in order to avoid baroque syntax
specifications, many constraints are actually completing the syntax
rules: if it was too difficult to put it in a formal way in a syntax
specification, it was put into plain English in a subsequent constraint.
A funny case is:
6.5.2.1 Array subscripting
Constraints
1 One of the expressions shall have type ``pointer to object type'',
the other expression shall have integer type, and the result
has type ``type''.
The first part is really dealing with syntax and the last part is pure
semantics.
Dan
-- Dan Pop DESY Zeuthen, RZ group Email: Dan.Pop@ifh.de
- Next message: Guillaume: "Re: What are the difference among them?"
- Previous message: Kevin Bracey: "Re: c89 and c99"
- In reply to: Jeremy Yallop: "Re: int pointing to char"
- Next in thread: Dan Pop: "Re: int pointing to char"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|