Skip to content

interpreters/bas: Fix compiler warning after gcc upgrade to version 12 #2225

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

Merged
merged 1 commit into from
Dec 10, 2023
Merged
Changes from all commits
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
2 changes: 1 addition & 1 deletion interpreters/bas/bas_token.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ struct Identifier
{
struct Symbol *sym;
enum ValueType defaultType;
char name[2/* ... */];
char name[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

This is C89 incompatible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, do you have better method?

Copy link
Contributor Author

@xiaoxiang781216 xiaoxiang781216 Dec 10, 2023

Choose a reason for hiding this comment

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

@pkarashchenko ci is broken now, it's better to merge this patch ASAP, and provide a better fix later.
Note: another ci error is fixed by apache/nuttx#11361.

Choose a reason for hiding this comment

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

Maybe encapsulate both in an #ifdef __STDC then c89 standard and char name[2] else char name[0]. I am not sure it will work, but if it does it should unblock the ci until we find a better long-term solution.

Copy link
Contributor Author

@xiaoxiang781216 xiaoxiang781216 Dec 10, 2023

Choose a reason for hiding this comment

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

@pkarashchenko please provide better method later, I have to merge this patch now to unblock ci.

};

struct Next
Expand Down