:: Re: [Frei0r] possible bug in macro …
Pàgina inicial
Delete this message
Reply to this message
Autor: salsaman
Data:  
A: Minimalistic plugin API for video effects
Assumpte: Re: [Frei0r] possible bug in macro definition in frei0r_math.h
On Tue, Aug 22, 2017 at 12:31 PM, Jaromil <jaromil@???> wrote:

>
> dear developers,
>
> while interacting over the contribution of a new normalization filter,
> the doubt of having found a bug emerged regarding the MIN/MAX macro
> definitions in frei0r_math.h, see
> https://github.com/dyne/frei0r/blob/master/include/frei0r_math.h#L67
>
> as you can see there are trailing semicolons on those macros, which
> shouldn't be there IMHO. the bug does not raise any problem in normal
> usage of macros on standalone lines (but also in case the MIN/MAX
> macros are already defined, according to enclosing #ifdefs). Yet the
> corner-case of the bug arises in this new plugin when build on
> travis-CI (ubuntu 14) since they are used inside a conditional, see:
> https://travis-ci.org/dyne/frei0r#L1715
>
> and that obviously breaks the C syntax rather than ignoring an
> additional semicolon at end of line.
>
> I am incline to consider this a bug in frei0r (thanks to @Chungzuwalla
> on github for spotting it!) and would like to proceed fixing. Are
> there strong opinion against this fix? at a quick glance on all frei0r
> codebase I believe this doesn't affects any other filter, it all
> compiles smoothly.
>
> ciao
>
>


+1 Jaromil.

Semicolons do not belong in macros, as you noted they can break syntax. We
should remove them.



Salsaman.




http://lives-video.com
https://www.openhub.net/accounts/salsaman