casaroli commented on code in PR #18340:
URL: https://github.com/apache/nuttx/pull/18340#discussion_r4439705620
##########
include/nuttx/lib/lib.h:
##########
@@ -28,9 +28,15 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <nuttx/fs/fs.h>
-#include <nuttx/kmalloc.h>
-
+#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
Review Comment:
lib_malloc() and lib_free() still map to kmm_malloc() and kmm_free() for
every `__KERNEL__` file, and the build adds `-D__KERNEL__` to the kernel
directories also in a flat build. Without nuttx/kmalloc.h and nuttx/fs/fs.h
these files lose declarations: the CI of this PR fails with "implicit
declaration of function 'kmm_malloc'", and on master plus this hunk
qemu-armv7a:nsh fails with "implicit declaration of function 'issetugid'" in
libs/libc/environ/env_secureexec.c.
Fix: keep `#include <nuttx/fs/fs.h>` and `#include <nuttx/kmalloc.h>`
without conditions, as on master.
##########
include/nuttx/streams.h:
##########
@@ -211,6 +211,7 @@ struct lib_rawoutstream_s
int fd;
};
+#ifndef CONFIG_DISABLE_MOUNTPOINT
Review Comment:
With CONFIG_DISABLE_MOUNTPOINT=y this hides struct lib_fileinstream_s and
lib_fileoutstream_s, but libs/libc/stream/Make.defs and CMakeLists.txt still
build lib_fileinstream.c and lib_fileoutstream.c. The msys2 CI job of this PR
fails with "invalid use of undefined type 'struct lib_fileinstream_s'"; 113
defconfigs set CONFIG_DISABLE_MOUNTPOINT=y.
Fix: drop this guard, or build the two files only under the same condition
in Make.defs and CMakeLists.txt.
##########
libs/libc/netdb/lib_getaddrinfo.c:
##########
@@ -187,12 +198,13 @@ int getaddrinfo(FAR const char *hostname, FAR const char
*servname,
{
/* Force network byte order */
- port = HTONS(port);
+ port = htons(port);
}
else if ((flags & AI_NUMERICSERV) != 0)
{
return EAI_NONAME;
}
+#if defined(CONFIG_NET_IPv4) || defined(CONFIG_NET_IPv6)
Review Comment:
lib_getservbynamer.c is always built with CONFIG_LIBC_NETDB, so this guard
is not needed. With only NET_LOCAL, NET_RPMSG or NET_VSOCK it makes a service
name return EAI_SERVICE. This block also conflicts with master now.
Fix: drop the guard and rebase on master.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]