Skip to content

Fix some unused variable warnings. #645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tmp
  • Loading branch information
Virgil Serbanuta committed Dec 10, 2020
commit 6441678627cb21ed071fa1ee0522976e3f846aa9
4 changes: 2 additions & 2 deletions semantics/c/language/translation/typing/canonicalization.k
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module C-TYPING-CANONICALIZATION
requires cfg:reservedKeywordSupported(Tok)
[structural]
rule (.K => SE("TCANON2","Unsupported reserved identifier "+String Tok +String " (reserved variant of restrict)."))
~> addMods(Mods::List ListItem(RestrictReserved(Tok::String, Loc::CabsLoc)), T:Type)
~> addMods(_Mods::List ListItem(RestrictReserved(Tok::String, _::CabsLoc)), _:Type)
requires notBool cfg:reservedKeywordSupported(Tok)
[structural]
rule addMods(Mods::List ListItem(Restrict()), T:Type)
Expand Down Expand Up @@ -123,7 +123,7 @@ module C-TYPING-CANONICALIZATION
context addMods(_ ListItem(AlignasExpression(HOLE:KItem)), _)
rule addMods(_::List ListItem(AlignasExpression(tv(A:Int, _)) => alignas(A)), _)
[structural]
rule addMods(Mods::List (ListItem(S:KItem) => .List), _:KResult)
rule addMods(_Mods::List (ListItem(S:KItem) => .List), _:KResult)
requires notBool isModifier(S)
andBool notBool isQualifier(S)
andBool notBool isReducibleModifier(S)
Expand Down
6 changes: 3 additions & 3 deletions semantics/c/language/translation/typing/expr.k
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ module C-TYPING-EXPR
rule typeof(+ T:Type => tryPromote(T))
rule typeof(- T:Type => tryPromote(T))
rule typeof(~ T:Type => tryPromote(T:Type))
rule typeof(! T:Type => type(int))
rule typeof(! _:Type => type(int))

rule typeof(SizeofExpression(T:Type) => SizeofType(T, .K))
rule typeof(SizeofType(T:Type, _)
Expand Down Expand Up @@ -257,10 +257,10 @@ module C-TYPING-EXPR
requires stripQualifiers(T) ==Type stripQualifiers(T')
andBool SizeofExpression(...) :/=K K

rule elaborateDone(V:K, V':K) ~> typeof(_ ? t(...) : (t(...) #as T'::Type))
rule elaborateDone(V:K, _V':K) ~> typeof(_ ? t(...) : (t(...) #as T'::Type))
=> typeof(stripQualifiers(T'))
requires isNPC(V) andBool isPointerType(T')
rule elaborateDone(V:K, V':K) ~> typeof(_ ? (t(...) #as T::Type) : t(...))
rule elaborateDone(_V:K, V':K) ~> typeof(_ ? (t(...) #as T::Type) : t(...))
=> typeof(stripQualifiers(T))
requires isNPC(V') andBool isPointerType(T)

Expand Down
2 changes: 1 addition & 1 deletion semantics/c/language/translation/typing/interpretation.k
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module C-TYPING-INTERPRETATION
~> ArrayType(_, tv(_:Float, _), _)
[structural]
rule (.K => CV("CTI2", "Arrays must have positive length."))
~> ArrayType(T:Type, tv(Len:Int, _), _)
~> ArrayType(_:Type, tv(Len:Int, _), _)
requires Len <=Int 0
[structural]
rule (.K => CV("CTI5", "Structs containing a flexible array member must not be array elements."))
Expand Down