https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107750

--- Comment #8 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot 
Uni-Bielefeld.DE> ---
When I hack <sys/socket.h> locally to avoid the indirection in the
definitions of the SOCK_* constants, only two gcc.dg/analyzer/fd-*.c
tests FAIL on Solaris:

FAIL: gcc.dg/analyzer/fd-access-mode-target-headers.c  (test for warnings, line
19)
FAIL: gcc.dg/analyzer/fd-access-mode-target-headers.c  (test for warnings, line
27)
FAIL: gcc.dg/analyzer/fd-access-mode-target-headers.c  (test for warnings, line
32)
FAIL: gcc.dg/analyzer/fd-access-mode-target-headers.c  (test for warnings, line
39)
FAIL: gcc.dg/analyzer/fd-access-mode-target-headers.c  (test for warnings, line
55)
FAIL: gcc.dg/analyzer/fd-access-mode-target-headers.c (test for excess errors)

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/fd-access-mode-target-headers.c:55:3:
warning: named constant 'O_ACCMODE' has unknown value

<sys/fcntl.h> (included from <fcntl.h>) has

#define O_ACCMODE       (O_SEARCH | O_EXEC | 0x3)

which analyzer cannot handle (not a simple numeric constant; same issue
as with SOCK_*).

Linux/glibc has instead

#define O_ACCMODE       00000003

FAIL: gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c (test for excess
errors)

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c:91:3:
error: implicit declaration of function 'memset'
[-Wimplicit-function-declaration]

Solaris <sys/select.h> has

#define FD_ZERO(__p)    (void) memset((__p), 0, sizeof (*(__p))) 

While one certainly could argue that the header should be
self-contained, it's easy enough to just include <string.h> in the test
to avoid this.

Reply via email to