-
Notifications
You must be signed in to change notification settings - Fork 157
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
[onert/frontend] Revisit traininfo metadata name #12410
Conversation
runtime/onert/frontend/circle_traininfo/include/traininfo_loader.h
Outdated
Show resolved
Hide resolved
8da26c3
to
9cfa7f7
Compare
9cfa7f7
to
2e085d5
Compare
static constexpr char *const TRAININFO_METADATA_NAME = "CIRCLE_TRAINING"; | ||
extern const char *const TRAININFO_METADATA_NAME; |
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.
While I was on the next step (next PR), I found an error :
ONE/runtime/onert/frontend/circle_traininfo/include/traininfo_loader.h:30:56:
error: ISO C++ forbids converting a string constant to ‘char*’ [-Werror=write-strings]
30 | static constexpr char *const TRAININFO_METADATA_NAME = "CIRCLE_TRAINING";
| ^~~~~~~~~~~~~~~~~
It looks like constexpr char*
doesn't mean that char-array(string) content is constant.
So, For clearness, Let's just remove constexpr
and use const
instead.
I refered stack-overflow https://stackoverflow.com/questions/30561104/const-constexpr-char-vs-constexpr-char.
I tried to find an official C++ document about this, But it's hard to find a clear explanation about this.
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.
Could you add a comment like below?
// TODO Change to inline variables since C++17
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.
updated!
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.
👍
8354437
to
ae4cd9e
Compare
This PR adds 'const' keyword to the traininfo metadata name. It also adds 'extern' keyword to follow one-definition-rule. ONE-DCO-1.0-Signed-off-by: SeungHui Youn <sseung.youn@samsung.com>
ae4cd9e
to
95a4b76
Compare
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.
LGTM and I have a question.
by zetwhite
This PR adds 'const' keyword to the traininfo metadata name.
It also adds 'extern' keyword to follow one-definition-rule.
Where can I find the reference to one-definition-rule
?
@YongseopKim
|
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.
LGTM
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.
LGTM
This PR adds 'const' keyword to the traininfo metadata name.
It also adds 'extern' keyword to follow one-definition-rule.
ONE-DCO-1.0-Signed-off-by: SeungHui Youn sseung.youn@samsung.com
related issue : #11692