[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scp.c compile warnings
  [Thread Prev] | [Thread Next]
 
 
- Subject: Re: scp.c compile warnings
- From: Andreas Schneider <mail@xxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 19 Aug 2009 11:09:46 +0200
- To: libssh@xxxxxxxxxx
On Tuesday 18 August 2009 16:33:07 Aris Adamantiadis wrote:
> Keisial a écrit :
> > Jean-Philippe Garcia Ballester wrote:
> >>> The first one can be fixed by #include <stdio.h>, but I am not sure
> >>> about a portable way to fix the second one. Maybe just cast to (long
> >>> int)?
> >>
> >>   Isn't %zd portable ?
> >
> > I don't think %zd would work on Windows.
> 
> We can "fix" that with a big (unsigned long long) cast like Andreas did
> for the other type issue :)
> 
#ifdef MSVC
#define PRIdS "Id"
#else
#define PRIdS "zd"
#endif
printf("size is %" PRIdS ".\n", (size_t) 5);
inttypes.h defines this for integers. to print uint64_t you use normally
printf("value is %" PRIu64 ".\n", (uint64_t) 5);
	-- andreas
Attachment:
signature.asc
Description: This is a digitally signed message part.
| scp.c compile warnings | Vic Lee <llyzs@xxxxxxx> | 
| Re: scp.c compile warnings | Keisial <keisial@xxxxxxxxx> | 
| Re: scp.c compile warnings | Aris Adamantiadis <aris@xxxxxxxxxxxx> | 

