This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: open(O_RDWR) and lseek() fail
- From: Bengt Larsson <lists dot cygwin4 at bengtl dot net>
- To: cygwin at cygwin dot com
- Date: Fri, 28 Mar 2014 19:13:39 +0100
- Subject: Re: open(O_RDWR) and lseek() fail
- Authentication-results: sourceware.org; auth=none
- References: <20140328093110 dot GA23367 at calimero dot vinschen dot de> <0D835E9B9CD07F40A48423F80D3B5A702CE06F27 at USA7109MB022 dot na dot xerox dot net>
- Reply-to: cygwin at cygwin dot com
Nellis, Kenneth wrote:
>So, then, after changing %d to %lld, gcc -Wall -pedantic complains:
>
>x.c: In function ?main?:
>x.c:12:2: warning: ISO C90 does not support the ?ll? gnu_printf length modifier [-Wformat=]
> printf("pos = %lld\n",lseek(f, 0l, SEEK_CUR));
> ^
>x.c:12:2: warning: ISO C90 does not support the ?ll? gnu_printf length modifier [-Wformat=]
Or you could use the standard: include <stdint.h> and:
printf("pos = %jd\n", (intmax_t)lseek(f, 0l, SEEK_CUR));
>
>Wondering how to printf an off_t value without the compiler complaining while
>using -Wall -pedantic.
>
>--Ken Nellis
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple