pkarashchenko commented on code in PR #7912:
URL: https://github.com/apache/nuttx/pull/7912#discussion_r1051603845


##########
net/local/local_connect.c:
##########
@@ -238,7 +238,9 @@ int psock_local_connect(FAR struct socket *psock,
 {
   FAR struct local_conn_s *client;
   FAR struct sockaddr_un *unaddr = (FAR struct sockaddr_un *)addr;
+  FAR const char *unpath = unaddr->sun_path;
   FAR struct local_conn_s *conn = NULL;

Review Comment:
   Yes, but in such way the C standard would always init stack variables :)
   The init is needed if pointer is not unconditionally overwritten. In this 
case the init  is followed by explicit overwrite in `while ((conn = 
local_nextconn(conn)) != NULL)`, so initing is only wasting CPU cycles.
   
   UPD: but seems I'm wrong as `conn` is passed as a parameter to 
`local_nextconn`, so init is needed for sure.



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to