You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/08/29 01:45:52 UTC

[nuttx] branch master updated: net/local: fix visual studio Compiler Error C2057

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new baabf4bbf3 net/local: fix visual studio Compiler Error C2057
baabf4bbf3 is described below

commit baabf4bbf34d751f2a99765ffcd8989ef57b705d
Author: chao an <an...@xiaomi.com>
AuthorDate: Mon Aug 28 11:05:33 2023 +0800

    net/local: fix visual studio Compiler Error C2057
    
    expected constant expression
    The context requires a constant expression, an expression whose value is known at compile time.
    The compiler must know the size of a type at compile time in order to allocate space for an instance of that type.
    
    Reference:
    https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2057?view=msvc-170
    Signed-off-by: chao an <an...@xiaomi.com>
---
 net/local/local_fifo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/local/local_fifo.c b/net/local/local_fifo.c
index 9c4ec91f82..7174857054 100644
--- a/net/local/local_fifo.c
+++ b/net/local/local_fifo.c
@@ -49,7 +49,7 @@
 #define LOCAL_HD_SUFFIX    "HD"  /* Name of the half duplex datagram FIFO */
 #define LOCAL_SUFFIX_LEN   2
 
-#define LOCAL_FULLPATH_LEN (strlen(CONFIG_NET_LOCAL_VFS_PATH) + \
+#define LOCAL_FULLPATH_LEN (sizeof(CONFIG_NET_LOCAL_VFS_PATH) + \
                             UNIX_PATH_MAX + LOCAL_SUFFIX_LEN + 2)
 
 /****************************************************************************