[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [msmtp-users] Compiler error during build



On Tue, May 29, 2007 at 12:00:48AM -0700, Steve Sakoman wrote:
> I'm attempting to cross compile msmtp for the gumstix platform (arm
> linux) and getting a compiler error.
> 
> net.c: In function `net_connect':
> net.c:284: error: incompatible type for argument 2 of `connect'
> net.c:296: error: incompatible type for argument 2 of `connect'

This happens because of the following ./configure argument:
> CFLAGS+="-std=iso9899:199x "

When this strict flag is set, then the header <sys/socket.h> defines
some types different from the normal behaviour. Without this flag, or
with "-std=gnu99", the program compiles fine.

Since the connect() calls in net.c conform to POSIX, they should work
with "-std=iso9899:199x". This may therefore be a bug in the header file
logic that defines types and features based on the language standard.
These headers are shared with glibc, and the same error happens with
glibc on a current Debian system. 

I had a lot of trouble with the -std=... flags in the past. I don't use
them anymore. Do you have a strong reason to use -std=iso9899:199x?

Regards,
Martin