Skip to content
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

Fix clang17++ compilation #133

Merged
merged 3 commits into from
Apr 11, 2024
Merged

Conversation

Ecordonnier
Copy link
Contributor

fix compilation error with clang++17

ocispec/runtime_spec_schema_config_schema.h contains the following code which uses the reserved c++ keyword "class":
typedef struct {
char *class;
int32_t priority;
yajl_val _residual;
unsigned int priority_present : 1;
}

Thus the code fails to compile with clang++ 17.

Fixes #132 ( #132 )

Signed-off-by: Etienne Cordonnier <[email protected]>
- Most implementations of __str__() use invalid syntax (passing self explicitly as first parameter of __repr__() is not valid python syntax since __repr__ does not take an explicit parameter).
For instance "print("schema_info: %s", schema_info)" triggers an error: "TypeError: SchemaInfo.__repr__() takes 1 positional argument but 2 were given"

- There is no reason to explicitly call __repr__() from __str__(), since this is the default python behavior

Signed-off-by: Etienne Cordonnier <[email protected]>
ocispec/runtime_spec_schema_config_schema.h contains the following code which uses the reserved c++ keyword "class":
typedef struct {
    char *class;
    int32_t priority;
    yajl_val _residual;
    unsigned int priority_present : 1;
}

Thus the code fails to compile with clang++ 17.

Fixes containers#132 ( containers#132 )

Signed-off-by: Etienne Cordonnier <[email protected]>
@Ecordonnier
Copy link
Contributor Author

@giuseppe @flouthoc PTAL

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

@giuseppe giuseppe merged commit c715dcd into containers:main Apr 11, 2024
6 checks passed
@Ecordonnier Ecordonnier deleted the eco/clang17 branch April 11, 2024 12:50
@flouthoc
Copy link
Collaborator

I'm late but LGTM :)

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.

Compilation error with clang++ 17
3 participants