Skip to content

Conversation

@nikswamy
Copy link
Contributor

Cf. Issue #143

then false
else let suffix' = String.sub s (l - sl) sl in
suffix = suffix'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to Utils

offsets |>
List.collect
(fun offset ->
if TypeSizes.is_alignment_field (fst offset)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exclude assertions on fields that are added for alignment padding; they are implicit in the C type

let env = B.mk_env genv, senv in
let ds = List.map (decl_size_with_alignment env) ds in
let ge = B.global_env_of_env (fst env) in
ds |> List.iter (fun d ->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the global environment with revised type declarations after fields (may) have been added for alignment padding

#ifndef C_ASSERT
#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1]
#endif
typedef char CIRCLE[20];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revise the test case, since we now also check offsets, not just sizes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants