Title: Theory / Unimportant / CS / Programming / C Harbison Steele{ / 07 Expressions+10
Tags: FromInstruction computer_to_instruction récupéré hasNotNewEffectReturnsMeaning hasSeenConjDef seen_description automatedNewLineAfterCommaSpace

Name: An object
Definition: can be examined
Page: 203
Chapter: 7
Section: 1
Definition2: can be stored into
Conjdef: a region of memory that

Name: An lvalue
Definition: a variable name
Page: 203
Chapter: 7
Section: 1
Definition2: e[k]
Conjdef: Either
Definition3: (e) for e an lvalue
Intuition: an expression that refers to an object in such a way that the object may be examined or altered.
Definition4: e.name for e an lvalue
Definition5: e->name
Definition6: *e
Definition7: a string constant

Name: An rvalue
Definition: an expression that is not an lvalue
Page: 203
Chapter: 7
Section: 1
Typ: object, incomplete type,
Counterexample: Something of type void

Name: A modifiable value
Definition: A value which can be modified
Page: 203
Chapter: 7
Section: 1

Name: A function designator
Definition: A value of function type
Page: 203
Chapter: 7
Section: 1
Example: name of a function
Example2: dereferencing a function pointer

Name: Overflow
Definition: When the result of an addition is greater than the maximal integer
Page: 206
Chapter: 7
Section: 2.2

Name: underflow
Definition: When the result of an addition is least than the least integer
Page: 206
Chapter: 7
Section: 2.2

Question: Result of division by 0
Answer: unpredictable
Page: 206
Chapter: 7
Section: 2.2
Context: C

Question: Result of modulo 0
Answer: unpredictable
Page: 206
Chapter: 7
Section: 2.2

Question: Result << or >> with too large value is
Answer: unpredictable
Page: 206
Chapter: 7
Section: 2.2

Question: Result << or >> with negative value is
Answer: unpredictable
Page: 206
Chapter: 7
Section: 2.2

Question: Result of signed integer overflow is
Answer: unpredictable
Page: 207
Chapter: 7
Section: 2.2

Question: Result of unsigned integer overflow is
Answer: the least bit of the correct result. That is, the result mod \(2^{s}\) with \(s\) the size of the word
Page: 207
Chapter: 7
Section: 2.2

Question: Result of float overflow is
Answer: unpredictable
Page: 207
Chapter: 7
Section: 2.2

Question: Result of float underflow is
Answer: unpredictable
Page: 207
Chapter: 7
Section: 2.2

Name: Primary expression
Definition: identifier (name)
Page: 207
Chapter: 7
Section: 3
Definition2: Constant
Conjdef: Either
Definition3: parenthesized-expression

Smaller0: the type of n is arithmetic, pointer, enumeration, structure or union
Greater0: an lvalue
Page: 208
Chapter: 7
Section: 31
Variables: n a name of variable
Prefix Greater: n's is
Smaller1: or
n is a string being initialized
Greater1: a value of the type of n
Connect Greater0: and
n evaluate to
Smaller2: the type is function of array,
Suffix Smaller: )
Smaller3: the name is an argument of sizeof or of &
Connect Smaller1: and (
Connect Smaller2: and

Smaller0: the type of n is array
Greater0: a pointer to the first object of the array
Page: 208
Chapter: 7
Section: 31
Variables: n a name of variable
Smaller to greater: iff
Prefix Greater: n is evaluated as
Smaller1: n is argument of & or of sizeof

Smaller0: the type of n is function
Greater0: a pointer to the function
Page: 208
Chapter: 7
Section: 3.1
Variables: n a name of variable
Smaller to greater: iff
Prefix Greater: n is evaluated as
Smaller1: n is argument of & or of sizeof

Name: A literal
Definition: A numeric constant
Page: 208
Chapter: 7
Section: 3.2
Name2: A lexical constant
Typ: not lvalue

Instruction: A numerical constant representing n
Page: 208
Language: C
Chapter: 7
Section: 3.2
Variables: n a number
Name: n

Instruction: (foo)
Page: 208
Effect: effect, value and type of foo
Language: C
Chapter: 7
Section: 3.3
Variables: foo an expression
Name: parenthesized-expression

Instruction: a numeric constant
Page: 209
Language: C
Chapter: 7
Section: 3.3
Returns: the value of the numeric constant
Name: literal (lexical constant)

Instruction: (foo)
Page: 209
Language: C
Chapter: 7
Section: 3.3
Returns: value of foo
Name: Parenthesized expression

Name: postfix-expression
Definition: primary-expression
Page: 209
Chapter: 7
Section: 4
Context: C
Definition2: subscript-expression
Conjdef: Either
Definition3: component-selection-expression
Definition4: function-call
Definition5: postincrement-expression postdecrement-expression
Definition6: compound-literal

Instruction: foo[bar]
Page: 209
Effect: evaluate foo and bar
Language: C
Chapter: 7
Section: 4
Returns: similar to *((foo)+(bar))
Name: subscript-expression

Question: Difference between
char buffer[100]
and
*bptr = buffer
Answer: bptr is an lvalue, not buffer
Page: 211
Chapter: 7
Section: 4
Context: C

Instruction: foo.bar
Page: 212
Effect: Evaluate foo
Language: C
Chapter: 7
Section: 4.2
Returns: the member bar of union type foo
Name: direct-component-selection

Instruction: foo->bar
Page: 212
Effect: Evaluate foo
Language: C
Chapter: 7
Section: 4.2
Returns: the member bar of the union object pointed by foo
Name: indirect-component-selection

Instruction: foo (
  bar_1,
  ...,
  bar_n
)
Page: 212
Effect: Evaluate foo and each bar_i.
Convert the bar_i to the type of the i-th parameter of the value of foo (assuming standard c prototype and only the variable which are not extra)
Apply the first result to each other result
Language: C
Chapter: 7
Section: 4.3
Name: function-call

Question: What is the result of changing a parameter of a function in its body
Answer: Changing the parameter has no effect outside of the function.
Dereferencing the parameter and changing the object designed by it is a change seen outside of the function
Page: 215
Chapter: 7
Section: 4.3