delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/03/28/14:14:03

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:reply-to:message-id
:references:in-reply-to:mime-version:content-type
:content-transfer-encoding; q=dns; s=default; b=G0ukwYbyX4dtlu2s
yjiZaWUst6L4oP8Gai3KESqlx1dqULpBW3g62W0t2+UaX3KqEKW58ge4rjt6gGEr
fvGetTGil5g/NTDTxg0pL075h1HUMEz/8houbIx+++znSaSeaB0NCjvO+4w1H5m1
nMm7TiMr1nXxgmzGGAKR2nhBLHM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:reply-to:message-id
:references:in-reply-to:mime-version:content-type
:content-transfer-encoding; s=default; bh=OGq2f66U8SezZSxCgV6P7B
EBg6Q=; b=w05uTGXprLSysl/CdzI7rdta4HHrWE/v6mEO+MOKPB/ENOop/gLp1q
Gei0FiWshz3tyB+ctEA8XFtFLV3a3IPZdFl5y9Dm+DIu7Xgg7GgAlxcUE0cj0GzS
1QFrL5NIIlaXFKWIRisr1ReMRewf8c6np7Cr/oGQ8H26/c0JpFvBU=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_JMF_BL autolearn=no version=3.3.2
X-HELO: homiemail-a54.g.dreamhost.com
From: Bengt Larsson <lists DOT cygwin4 AT bengtl DOT net>
To: cygwin AT cygwin DOT com
Subject: Re: open(O_RDWR) and lseek() fail
Date: Fri, 28 Mar 2014 19:13:39 +0100
Reply-To: cygwin AT cygwin DOT com
Message-ID: <eqebj9t2gi572mj6fnp17sal574g5ii1hd@4ax.com>
References: <20140328093110 DOT GA23367 AT calimero DOT vinschen DOT de> <0D835E9B9CD07F40A48423F80D3B5A702CE06F27 AT USA7109MB022 DOT na DOT xerox DOT net>
In-Reply-To: <0D835E9B9CD07F40A48423F80D3B5A702CE06F27@USA7109MB022.na.xerox.net>
User-Agent: ForteAgent/7.20.32.1218
MIME-Version: 1.0
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id s2SIDv8U015244

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019