Closed natronics closed 10 years ago
The following test program doesn't give me any warnings or errors when compiled with gcc -Wall -std=c99 -S test.c
.
#include <netinet/in.h>
#define make_addr(port, addr) (const struct sockaddr *) &(const struct sockaddr_in){ \
.sin_family = AF_INET, \
.sin_port = (port), \
.sin_addr = { (addr) } }
const struct sockaddr *addr = make_addr(12, 0x7F000001);
void test(void)
{
connect(-1, make_addr(1234, 0x7F000001), sizeof(struct sockaddr_in));
}
@jameysharp sez: it should work if were using gcc and/or in c99 mode.