This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin g++ strictness


On Oct 31 16:19, Peter Rosin wrote:
> Den 2008-10-31 14:50, skrev Corinna Vinschen:
>> On Oct 31 07:26, Eric Blake wrote:
>>> But yes, it might be nice if cygwin used the same type as Linux, as we
>>> claim to strive for Linux source compatibility.
>> Why exactly?  The important thing here is that int32_t is 32 bit wide,
>> regardless of using int or long as base type.
>
> I some projects I'm involved with there's quite a bit of the following:
>
> $ cat int.c
> #include <stdio.h>
> int
> main(void)
> {
> 	int32_t i = 32;
> 	printf("%d", i);
> 	return 0;
> }
> $ gcc -c -Wall int.c
> int.c: In function `main':
> int.c:6: warning: int format, int32_t arg (arg 2)
> int.c:6: warning: int format, int32_t arg (arg 2)
>
> What should the format specifier be to not have that warning
> on neither Cygwin nor Linux? (or anywhere for that matter)

  printf("%ld", (long) i);


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]