Test that calls select fails on vxworks because select is only
declared in sys/select.h.  Include that header if it's present.

Regstrapped on x86_64-linux-gnu.  Also tested with gcc-13 on arm-,
aarch64-, x86- and x86_64-vxworks7r2.  Ok to install?


for  gcc/testsuite/ChangeLog

        * gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c:
        Include sys/select.h if present.
---
 .../fd-glibc-byte-stream-connection-server.c       |    3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c 
b/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c
index fcbcc740170e6..f922a52238f90 100644
--- a/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c
@@ -8,6 +8,9 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/types.h>
+#if __has_include(<sys/select.h>)
+#include <sys/select.h>
+#endif
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>

-- 
Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
   Free Software Activist                   GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity
Excluding neuro-others for not behaving ""normal"" is *not* inclusive

Reply via email to