bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] timeout: remove problematic casts


From: Jim Meyering
Subject: Re: [PATCH] timeout: remove problematic casts
Date: Tue, 23 Dec 2008 10:57:36 +0100

Pádraig Brady <address@hidden> wrote:
> There is some dodgy casts in timeout.c that are being
> flagged by `gcc -fstrict-aliasing -Wstrict-aliasing`
> The attached patch hopefully addresses this.
>
> cheers,
> Pádraig.
>>From 693467d432a4718068137e97c5655b7b8ff0f86c Mon Sep 17 00:00:00 2001
> From: =?utf-8?q?P=C3=A1draig=20Brady?= <address@hidden>
> Date: Tue, 23 Dec 2008 09:36:22 +0000
> Subject: [PATCH] timeout: remove problematic casts
>
> src/timeout.c (apply_time_suffix): Change input parameter from unsigned int
> to unsigned long, which is the type of the variable it actually manipulates.
> This removes the need for the cast which was giving a warning with the
> gcc options: -fstrict-aliasing -Wstrict-aliasing
> Also add a check for overflow possible on 16 bit platforms, and fix indents.
> Outside this function a redundant cast is removed in the alarm() call.

Thanks.  That looks fine.
Please adjust the body of the log to be more in the ChangeLog style,
since the distribution ChangeLog file is generated from
the git logs. i.e.,
- hard limit of 72 columns (to accommodate eventually-added leading TAB)
- "*" before FILE_NAME (FUNCTION_NAME):
- list each affected function

* src/timeout.c (apply_time_suffix): Change input parameter from
unsigned int to unsigned long, which is the type of the variable it
actually manipulates.  This removes the need for the cast which was
giving a warning with the gcc options: -fstrict-aliasing
-Wstrict-aliasing.  Also add a check for overflow possible on 16-bit
platforms, and fix indents.
(main): Remove a redundant cast in the alarm() call.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]