On Wed, May 25, 2011 at 03:08:16PM +0200, Kornel wrote:
> Am Mittwoch, 25. Mai 2011 schrieb Enrico Forestieri:
> > int main()
> > {
> > printf("result: %d\n", afunc());
> > return 0;
> > }
>
> You explicitly tell here printf() to get singned int.
Ok, but it does not change things. Try the attached better example.
--
Enrico
#include <stdio.h>
#include <time.h>
time_t afunc()
{
return (unsigned int)0xFFFFFFFF;
}
int main()
{
if (afunc() < 0)
printf("time_t is signed\n");
else
printf("time_t is unsigned\n");
return 0;
}