-
Notifications
You must be signed in to change notification settings - Fork 683
Aftermath of PRs #1505 and #1755 #1771
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
Aftermath of PRs #1505 and #1755 #1771
Conversation
cc @t-harvey |
{ | ||
.property_ref.value_p = NULL, | ||
.property_p = NULL | ||
}; |
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.
I have never seen such an initializator construct, does it C99?
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.
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.
Absolutely. Also, see: http://en.cppreference.com/w/c/language/struct_initialization
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.
But it can be written in an even shorter form. Pushed an update to the PR.
PR jerryscript-project#1505 added support for TI compiler. It explicitly added a message to notify the user that static linking is forced. PR jerryscript-project#1755 added a more generic approach to signal such forced settings and adapted the TI-specific static linking notification to this approach. However, it turned out that TI forcibly changed another setting, too: it disabled release binary stripping, but without notification. This patch fixes this by moving the setting override to a consistent place and adding a notification. PR jerryscript-project#1505 also added some source code changes, most importantly a complex struct initialization for a variable in `ecma-objects-general.c`. However, that initialization was coded as a macro to trick the style checker. This patch gets rid of that macro and uses proper C99 struct initializer with designators. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]
/* This #def just gets around the syntax/style checker... */ | ||
#define extended_property_ref_initialization { { 0 } , 0 } | ||
ecma_extended_property_ref_t ext_property_ref = extended_property_ref_initialization; | ||
ecma_extended_property_ref_t ext_property_ref = { .property_ref.value_p = NULL, .property_p = NULL }; |
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.
Is this not captured by the style checker anymore?
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.
vera
passes, CI is green. And #1773 just landed with a very similar construct (curly-braces-wise).
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.
Yes, this is valid. Multiply open braces in the same line is what the vera rule cannot handle.
Any formal reviews on this? (Thanks in advance) |
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
PR #1505 added support for TI compiler. It explicitly added a
message to notify the user that static linking is forced. PR #1755
added a more generic approach to signal such forced settings and
adapted the TI-specific static linking notification to this
approach. However, it turned out that TI forcibly changed another
setting, too: it disabled release binary stripping, but without
notification. This patch fixes this by moving the setting override
to a consistent place and adding a notification.
PR #1505 also added some source code changes, most importantly a
complex struct initialization for a variable in
ecma-objects-general.c
. However, that initialization was codedas a macro to trick the style checker. This patch gets rid of that
macro and uses proper C99 struct initializer with designators.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]