-
Notifications
You must be signed in to change notification settings - Fork 542
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
interpreters/bas: Fix compiler warning after gcc upgrade to version 12 #2225
Conversation
Please ignore the nxstyle warning:
|
ci break is fixed here: apache/nuttx#11357 |
@xiaoxiang781216
I am guessing the docker image was not up to date when you ran the test |
bas_token.l: In function 'yylex': Error: bas_token.l:1210:31: error: 'strcpy' writing 1 or more bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=] 1210 | } | ^ In file included from bas_auto.h:77, from bas_token.l:16: bas_token.h:103:8: note: at offset 2 into destination object 'name' of size 2 103 | char name[2/* ... */]; | ^~~~ Signed-off-by: Xiang Xiao <[email protected]>
83f17ee
to
db3065a
Compare
let's me restart the ci to see the result. |
@@ -100,7 +100,7 @@ struct Identifier | |||
{ | |||
struct Symbol *sym; | |||
enum ValueType defaultType; | |||
char name[2/* ... */]; | |||
char name[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is C89 incompatible.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Summary