Re: determine base type of a typedef

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Is it not possible to always use "%lld" and always convert the
> arguments to (long long int)?

This is what I'm doing right now. GCC on Linux doesn't generate any
warnings in any case, though I'm not sure this is a clean way of doing
things, taking into account Clang on other archs and platforms. I'm
investigating it right now. That's why the initial question.

With respect to converting the arguments to (long long int), if I
understand you correctly, you suggest to cast the values? This is not
the desired way of solving this type of things.

I'll quote Ellie Timoney here:

>From a maintenance point of view, casting usually means "there's
something tricky going on here; treat carefully". If we start littering
every formatted string with casts, it becomes impossible to tell which
ones are actually something tricky, and which ones are just annoying
platform workarounds. The right place for platform workarounds is
configure.ac


On 23/10/20 04:00, Vivien Kraus wrote:
> Hello Anatoli,
> 
> Le jeudi 22 octobre 2020 à 19:23 -0300, Anatoli a écrit :
>> #if (AC_TYPE(time_t) == "long long int")
>> #define TIME_T_FMT "%lld"
>> #elif (AC_TYPE(time_t) == "long int")
>> #define TIME_T_FMT "%ld"
>> #else
>> #error dont know what to use for TIME_T_FMT
>> #endif
> 
> Is it not possible to always use "%lld" and always convert the
> arguments to (long long int)?
> 
> Best regards,
> 
> divoplade
> 
> 




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux