]> The Tcpdump Group git mirrors - tcpdump/commit
Address some issues with XL C on Linux/POWER9.
authorDenis Ovsienko <[email protected]>
Tue, 27 Jul 2021 13:06:28 +0000 (14:06 +0100)
committerDenis Ovsienko <[email protected]>
Tue, 27 Jul 2021 13:24:01 +0000 (14:24 +0100)
commitc3c949e98e9d046a2017a122ba869c89329acdd1
tree3952e31733037b8dcd26cb3eaba5cd0fbebd972c
parentd3312a6438748730f40e4fd3cbd0dfc56ae16c54
Address some issues with XL C on Linux/POWER9.

XL C 16.1.1 Community Edition for Linux generated three warnings for
every file:

In file included from ./tcpdump.c:155:
./netdissect.h:254:8: warning: 1540-2990 The attribute
"__attribute__((format(printf, 2, 3)))" is not supported. The
      attribute is ignored.
                     PRINTFLIKE_FUNCPTR(2, 3);
                     ^
./netdissect.h:259:10: warning: 1540-2990 The attribute
" __attribute__((format(printf, 3, 4)))" is not supported.
      The attribute is ignored.
                                     PRINTFLIKE_FUNCPTR(3, 4);
                                     ^
./netdissect.h:263:9: warning: 1540-2990 The attribute
" __attribute__((format(printf, 2, 3)))" is not supported. The
      attribute is ignored.
                      PRINTFLIKE_FUNCPTR(2, 3);
                      ^

As it turns out, this is a bug in the compiler. In compiler-tests.h
update ND_IS_AT_LEAST_XL_C_VERSION() to tell newer XL C versions. In
funcattrs.h exempt XL C 16.1 from PRINTFLIKE_FUNCPTR().

In the course of preparing these changes notice that XL C uses the Clang
block in diag-control.h (XL C mimics both Clang and GCC to some extent),
although the behaviour is different between the two compilers. Add a new
block for XL C there.

In build_common.sh add more comments to explain XL C quirks and detect
XL C for Linux too so it receives the right CFLAGS. Update CHANGES to
mention this and earlier improvements.
CHANGES
build_common.sh
compiler-tests.h
diag-control.h
funcattrs.h