[vdr] Re: [ANNOUNCE] VDR developer version 1.3.47

Werner Schweer ws at seh.de
Sun Apr 23 11:21:57 CEST 2006

On Sunday 23 April 2006 10:43, Klaus Schmidinger wrote:
> Anssi Hannula wrote:
> > Klaus Schmidinger wrote:
> >>Reinhard Nissl wrote:
> >>>I've got a report of a similar warning in vdr-xine. I suggest this
> >>>solution:
> >>>
> >>>esyslog("ERROR: can't allocate %ld bytes for index '%s'", (long)(size
> >>>* sizeof(tIndex)), fileName);
> >>
> >>To be honest, I don't like this.
> >>Shouldn't this work on both 32- and 64bit systems without the need of
> >>typecasting?
> >
> > The return type of sizeof() is size_t. The size of size_t is
> > implementation-defined. With GCC that's unsigned int on ix86 and
> > unsigned long on x86_64.
> Does this mean that one would have to use different conversion
> specifiers on 32- and 64bit systems? Sounds like a compiler bug
> to me, because the source code should compile corretcly on both
> systems...

"man fprintf" says there is a special "z" length modifier for size_t
arguments, so "...%zd..." should do the trick


More information about the vdr mailing list