You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/07/28 06:08:20 UTC

[GitHub] [incubator-nuttx] easonxiang opened a new pull request, #6723: sched: Fill the gap in the structures.

easonxiang opened a new pull request, #6723:
URL: https://github.com/apache/incubator-nuttx/pull/6723

   The gaps may caused build issue in some complers.
   
   Signed-off-by: xiangdong6 <xi...@xiaomi.com>
   
   ## Summary
   
   ## Impact
   
   ## Testing
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6723: sched: Fill the gap in the structures.

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6723:
URL: https://github.com/apache/incubator-nuttx/pull/6723#discussion_r934038522


##########
sched/mqueue/mqueue.h:
##########
@@ -65,11 +65,7 @@ struct mqueue_msg_s
   struct list_node node;   /* Link node to message */
   uint8_t type;            /* (Used to manage allocations) */
   uint8_t priority;        /* Priority of message */
-#if MQ_MAX_BYTES < 256
-  uint8_t msglen;          /* Message data length */

Review Comment:
   I see some discussion here: https://developercommunity.visualstudio.com/t/error-msb6006-clexe-exited-with-code-2/405001
   ```
   RESOLUTION
   
   I discovered than I had a function declared as "int func()" had no return statement.
   
   When I changed the declaration to "void func()", the problem went away.
   ```
   There are also some other related discussion. IMO adding padding bytes is unacceptable solution



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6723: sched: Fill the gap in the structures.

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6723:
URL: https://github.com/apache/incubator-nuttx/pull/6723#discussion_r932893274


##########
sched/mqueue/mqueue.h:
##########
@@ -65,11 +65,7 @@ struct mqueue_msg_s
   struct list_node node;   /* Link node to message */
   uint8_t type;            /* (Used to manage allocations) */
   uint8_t priority;        /* Priority of message */
-#if MQ_MAX_BYTES < 256
-  uint8_t msglen;          /* Message data length */

Review Comment:
   From the PR description and changes itself I do not understand the state of the problem you are trying to fix. Could you please provide a wider description? I'm just wondering how things worked till now on so many platforms without an issue, but suddenly needs a padding bytes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] mlyszczek commented on a diff in pull request #6723: sched: Fill the gap in the structures.

Posted by GitBox <gi...@apache.org>.
mlyszczek commented on code in PR #6723:
URL: https://github.com/apache/incubator-nuttx/pull/6723#discussion_r932733242


##########
sched/mqueue/mqueue.h:
##########
@@ -65,11 +65,7 @@ struct mqueue_msg_s
   struct list_node node;   /* Link node to message */
   uint8_t type;            /* (Used to manage allocations) */
   uint8_t priority;        /* Priority of message */
-#if MQ_MAX_BYTES < 256
-  uint8_t msglen;          /* Message data length */

Review Comment:
   I don't think this is going to be true for 8bit processors? Not 100% sure but I'm pretty sure alignment on 8bit mcu will be 1byte.
   
   Since nuttx claims it's working fine even on 8bit mcu, it may not be best thing to do. Same thing with adding ```unsigned char``` as padding. What about 8bit mcus? They don't need padding there.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] mlyszczek commented on a diff in pull request #6723: sched: Fill the gap in the structures.

Posted by GitBox <gi...@apache.org>.
mlyszczek commented on code in PR #6723:
URL: https://github.com/apache/incubator-nuttx/pull/6723#discussion_r933770630


##########
sched/mqueue/mqueue.h:
##########
@@ -65,11 +65,7 @@ struct mqueue_msg_s
   struct list_node node;   /* Link node to message */
   uint8_t type;            /* (Used to manage allocations) */
   uint8_t priority;        /* Priority of message */
-#if MQ_MAX_BYTES < 256
-  uint8_t msglen;          /* Message data length */

Review Comment:
   Looks to me like a compiler that does not follow c standard.
   
   > Within a structure object, the non-bit-field members and the units in which bit-fields reside have addresses that increase in the order in which they are declared. A pointer to a structure object, suitably converted, points to its initial member (or if that member is a bit-field, then to the unit in which it resides), and vice versa.
   
   > _**There may be unnamed padding within a structure object, but not at its beginning.**_
   
   So compiler is allowed to put paddings whenever it wants (to properly align data). That means, if compiler notices unaligned data in struct, it may or may not add padding (compiler can decide whether speed or size is more important), but there should be no error, as both situations are ok according to standard.
   
   And what is error MSB6006? Looks like generic error. Can you post whole output for this error?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] easonxiang commented on a diff in pull request #6723: sched: Fill the gap in the structures.

Posted by GitBox <gi...@apache.org>.
easonxiang commented on code in PR #6723:
URL: https://github.com/apache/incubator-nuttx/pull/6723#discussion_r933709396


##########
sched/mqueue/mqueue.h:
##########
@@ -65,11 +65,7 @@ struct mqueue_msg_s
   struct list_node node;   /* Link node to message */
   uint8_t type;            /* (Used to manage allocations) */
   uint8_t priority;        /* Priority of message */
-#if MQ_MAX_BYTES < 256
-  uint8_t msglen;          /* Message data length */

Review Comment:
   Yes, it's working fine in the linux buid system. I'm trying to build nuttx in visual studio. The whole project was created by cmake with options: `-G"Visual Studio 17 2022" -A Win32`, it reports `error: MSB6006` for these structures. If add padding, the compile passed.
   In the meanwhile, I'm also trying to check if the VS can be configured to ignore this error, nothing found at present.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] easonxiang commented on a diff in pull request #6723: sched: Fill the gap in the structures.

Posted by GitBox <gi...@apache.org>.
easonxiang commented on code in PR #6723:
URL: https://github.com/apache/incubator-nuttx/pull/6723#discussion_r931817094


##########
sched/mqueue/mqueue.h:
##########
@@ -65,11 +65,7 @@ struct mqueue_msg_s
   struct list_node node;   /* Link node to message */
   uint8_t type;            /* (Used to manage allocations) */
   uint8_t priority;        /* Priority of message */
-#if MQ_MAX_BYTES < 256
-  uint8_t msglen;          /* Message data length */

Review Comment:
   if use uint8_t for msglen, a reserved uint8 is required for 4 bytes aligned.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] easonxiang commented on a diff in pull request #6723: sched: Fill the gap in the structures.

Posted by GitBox <gi...@apache.org>.
easonxiang commented on code in PR #6723:
URL: https://github.com/apache/incubator-nuttx/pull/6723#discussion_r934096999


##########
sched/mqueue/mqueue.h:
##########
@@ -65,11 +65,7 @@ struct mqueue_msg_s
   struct list_node node;   /* Link node to message */
   uint8_t type;            /* (Used to manage allocations) */
   uint8_t priority;        /* Priority of message */
-#if MQ_MAX_BYTES < 256
-  uint8_t msglen;          /* Message data length */

Review Comment:
   Okay, will abandon this PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] easonxiang closed pull request #6723: sched: Fill the gap in the structures.

Posted by GitBox <gi...@apache.org>.
easonxiang closed pull request #6723: sched: Fill the gap in the structures.
URL: https://github.com/apache/incubator-nuttx/pull/6723


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org