On Wed, Dec 30, 2020 at 4:11 AM Tom Lane <[email protected]> wrote:
> Alexander Korotkov <[email protected]> writes:
> > Multirange datatypes
>
> Multiple buildfarm members are issuing similar warnings about
> multirangetypes.c:
>
>  calliphoridae | 2020-12-29 23:10:11 | 
> /home/andres/build/buildfarm-calliphoridae/HEAD/pgsql.build/../pgsql/src/backend/utils/adt/multirangetypes.c:218:37:
>  warning: suggest braces around empty body in an 'else' statement 
> [-Wempty-body]
>  calliphoridae | 2020-12-29 23:10:11 | 
> /home/andres/build/buildfarm-calliphoridae/HEAD/pgsql.build/../pgsql/src/backend/utils/adt/multirangetypes.c:236:37:
>  warning: suggest braces around empty body in an 'else' statement 
> [-Wempty-body]
>
> These are evidently unhappy with code like
>
>                 if ...
>                    ...
>                 }
>                 else
>                      /* include it in range_str */ ;
>
> So apparently preferred style is more like
>
>                 else
>                 {
>                      /* include it in range_str */
>                 }
>
> I don't particularly care for the wording of this comment, either:
> it looks like it's describing an action that's about to be taken,
> only there's no action there.  Could it say something more like
> "we already included it in range_str", or "we'll include it in
> range_str below the switch", or whatever's appropriate?

Thank you for noticing.  I've slightly refactored this function in 16d531a30a.

------
Regards,
Alexander Korotkov


Reply via email to