This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3 1/2] Y2038: Add 64-bit time for all architectures
On Sat, 16 Jun 2018, Albert ARIBAUD (3ADEV) wrote:
> +#include <bits/wordsize.h> // for __WORDSIZE
We should avoid // comments (in general, and in installed headers we want
to be C90-compatible). And there's no point in a comment on an include
when it's completely obvious what the include is for.
> +/* Size in bits of the 'time_t' type; equals __WORDSIZE except for x32 */
> +#define __TIMESIZE __WORDSIZE
Missing '.' at end of comment. I don't think you need the "equals
__WORDSIZE except for x32" here (after all, it's logically a peculiarity
of x32 for the Linux kernel and this is a generic file).
> +#if __TIMESIZE == 64
> +/* If we already have 64-bit time then use it */
> +#define __TIME64_T_TYPE __TIME_T_TYPE
> +#else
> +/* Define a 64-bit type alongsize the 32-bit one */
> +#define __TIME64_T_TYPE __SQUAD_TYPE
> +#endif
Comments should end ". " (full stop, two spaces). Missing preprocessor
indentation ("# define" inside #if, with an extra space per level of
conditionals other than the multiple-include guards on a whole header
file).
> +/* check whether a time64_t value fits in a time_t */
Comments should start with a capital letter, end ". " as above.
--
Joseph S. Myers
joseph@codesourcery.com