Skip to content

Is this code to be commented on? #2

@morido

Description

@morido

Is this code actually supposed to be human-readable. I.e. are we encouraged to examine it and pose questions?

If so, here are three:

  1. Apparently, this code is auto-generated. So I would expect it to follow a uniform style. However, members of structs are accessed both through (*x).y and via x->y. Is there any reason for this?
  2. The casting functions are often dead code. E.g. consider CAST_Int_to_D_CYCLOC_TM_conversions(). This essentially performs an int to int conversion.
    Now dead code is not per se a problem. However, I am inclined to assume that the typedef'd target type D_CYCLOC is indeed more constrained than the source type kcg_int. So there ought to be some logic here...
    Or did you perhaps define a valid range for D_CYCLOC inside SCADE but its KCG component can preserve this constraint only when targeting Ada and not with C (which would be really bad)?
  3. I tried to trace the origins of D_CYCLOC in hopes of finding a sanity check for its contents at some earlier point. Unfortunately, I had to stop when stumbling on kcg_copy_array_int_8(), which is essentially defined in a file called kcg_assign.h. However, this file does not seem to be present anywhere in the repository. Am I missing something here?

Perhaps someone can enlighten me?

Cheers,
Moritz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions