Re: [dev] [PATCH][blind] alloca #include for BSDs

2018-01-28 Thread fao_

On 2018-01-28 10:18 pm, Yuri wrote:

Additionally, -D_XOPEN_SOURCE=700 causes build failures on FreeBSD. I
had to patch it away in both cases. Not sure what it is and why it is
there, just reporting this problem.


-D_XOPEN_SOURCE=700 is equal to #include _XOPEN_SOURCE 700

It states that the compiler should use POSIX 2008 with XSI extensions.
FreeBSD supports POSIX 2008 as far as I can tell, so this is probably a 
bug with their implementation.

Could you please post the error that occured?

--
- fao_
PGP fingerprint: 739B 6C5C 3DE1 33FA
"Too enough is always not much!"



Re: [dev] [PATCH][blind] alloca #include for BSDs

2018-01-28 Thread Yuri

On 01/28/18 13:29, Mattias Andrée wrote:

Thanks again!

I will be fixing this, but probably via config.mk.



You're welcome!



Few more things:


You should also change your config.mk files to allow external 
optimization and other flags. For example:


> CFLAGS   = -std=c99 -Wall -pedantic -O2

should be changed to

> CFLAGS   ?= -O2

> CFLAGS   += -std=c99 -Wall -pedantic -O2

This way you can allow externally supplied optimization flags while 
still being able to add your own flags. Same with CPPFLAGS and LDFLAGS.


I looked at blind and sbase projects, this applies to both.


Additionally, -D_XOPEN_SOURCE=700 causes build failures on FreeBSD. I 
had to patch it away in both cases. Not sure what it is and why it is 
there, just reporting this problem.



Cheers!
Yuri



Re: [dev] [PATCH][blind] alloca #include for BSDs

2018-01-28 Thread Mattias Andrée
On Sun, 28 Jan 2018 13:24:06 -0800
Yuri  wrote:

> BSDs use different header for alloca than Linux.
> 
> It sucks when it only works on Linux.
> 
> 
> Thanks,
> 
> Yuri
> 
> 
> 
> --- src/blind-split.c.orig  2017-05-06 11:27:39 UTC
> +++ src/blind-split.c
> @@ -2,7 +2,11 @@
>   #include "stream.h"
>   #include "util.h"
> 
> +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) 
> || defined(__DragonFly__)
> +#include 
> +#else
>   #include 
> +#endif
>   #include 
>   #include 
>   #include 
> 
> 

Thanks again!

I will be fixing this, but probably via config.mk.


Mattias Andrée



Re: [dev] [BUG REPORT] blind: clang-40 warning: variable 'frames' is uninitialized when used here

2018-01-28 Thread Mattias Andrée
On Sun, 28 Jan 2018 13:21:12 -0800
Yuri  wrote:

> src/blind-from-video.c:234:25: warning: variable 'frames' is 
> uninitialized when used here [-Wuninitialized]
>      SPRINTF_HEAD_ZN(head, frames, width, height, "xyza", 
> );
>    ^~
> src/stream.h:9:12: note: expanded from macro 'SPRINTF_HEAD_ZN'
>      (size_t)(FRAMES), (size_t)(WIDTH), (size_t)(HEIGHT), 
> PIXFMT, 0, LENP)
>   ^~
> src/blind-from-video.c:178:38: note: initialize the variable 'frames' to 
> silence this warning
>      size_t width = 0, height = 0, frames;
>      ^
>   = 0
> 
> 

Hi, thanks for the report!

I've a lot of changes in the works, I will apply this (if I haven't
already fixed it that is), but it will take some times before you
will see it.


Mattias Andrée


pgp5Qhv6VjDKd.pgp
Description: OpenPGP digital signature


[dev] [PATCH][blind] alloca #include for BSDs

2018-01-28 Thread Yuri

BSDs use different header for alloca than Linux.

It sucks when it only works on Linux.


Thanks,

Yuri



--- src/blind-split.c.orig  2017-05-06 11:27:39 UTC
+++ src/blind-split.c
@@ -2,7 +2,11 @@
 #include "stream.h"
 #include "util.h"

+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) 
|| defined(__DragonFly__)

+#include 
+#else
 #include 
+#endif
 #include 
 #include 
 #include 




[dev] [BUG REPORT] blind: clang-40 warning: variable 'frames' is uninitialized when used here

2018-01-28 Thread Yuri
src/blind-from-video.c:234:25: warning: variable 'frames' is 
uninitialized when used here [-Wuninitialized]
    SPRINTF_HEAD_ZN(head, frames, width, height, "xyza", 
);

  ^~
src/stream.h:9:12: note: expanded from macro 'SPRINTF_HEAD_ZN'
    (size_t)(FRAMES), (size_t)(WIDTH), (size_t)(HEIGHT), 
PIXFMT, 0, LENP)

 ^~
src/blind-from-video.c:178:38: note: initialize the variable 'frames' to 
silence this warning

    size_t width = 0, height = 0, frames;
    ^
 = 0