apps, func_tests: adapt cflags for older architectures
Quoting RFC3493:
One simple addition to the sockets API that can help application
writers is the "struct sockaddr_storage". This data structure can
simplify writing code that is portable across multiple address
families and platforms. This data structure is designed with the
following goals.
- Large enough to accommodate all supported protocol-specific address
structures.
- Aligned at an appropriate boundary so that pointers to it can be
cast as pointers to protocol specific address structures and used
to access the fields of those structures without alignment
problems.
The sockaddr_storage structure contains field ss_family which is of
type sa_family_t. When a sockaddr_storage structure is cast to a
sockaddr structure, the ss_family field of the sockaddr_storage
structure maps onto the sa_family field of the sockaddr structure.
When a sockaddr_storage structure is cast as a protocol specific
address structure, the ss_family field maps onto a field of that
structure that is of type sa_family_t and that identifies the
protocol's address family.
So then don't let the compiler bitch about this and use the same flag
to work around this as the Linux kernel does.
Here's what GCC version is affected:
gcc (GCC) 4.4.7
20120313 (Red Hat 4.4.7-3) --> complains
gcc (GCC) 4.7.2
20120921 (Red Hat 4.7.2-2) --> doesn't complain
Also, we add -O2 for additional data flow analysis that otherwise we
wouldn't have.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>