bug-gcal
[Top][All Lists]
Advanced

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

gcal-4.1 bug report


From: David Binderman
Subject: gcal-4.1 bug report
Date: Fri, 15 Apr 2022 08:14:43 +0000

Hello there,

I just tried to compile the package with new C compiler clang-14.
It said:

rc-use.c:705:25: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]

Source code is

       day += (-DAY_MAX + SDAY (DAY_MAX - wd + 1, start_day));

but

# define SDAY(gc_d, gc_s)    (  ((gc_d)+(gc_s)-1) > DAY_MAX) \
                                ? ((gc_d)+(gc_s)-(DAY_MAX+1)) \
                                : ((gc_d)+(gc_s)-1)

Suggest add extra () around the definition of SDAY:

# define SDAY(gc_d, gc_s)    ((  ((gc_d)+(gc_s)-1) > DAY_MAX) \
                                ? ((gc_d)+(gc_s)-(DAY_MAX+1)) \
                                : ((gc_d)+(gc_s)-1))

Regards

David Binderman






reply via email to

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