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

From: Yuri <yuri_AT_rawbw.com>
Date: Mon, 29 Jan 2018 09:34:03 -0800

On 01/28/18 19:47, fao_ wrote:
>
> -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?


See sbase and blind error logs when built with -D_XOPEN_SOURCE=700 below.


Yuri


---sbase errors---

flock.c:21:38: error: use of undeclared identifier 'LOCK_EX'
         int fd, status, savederrno, flags = LOCK_EX, nonblk = 0, oflag = 0;
                                             ^
flock.c:26:12: error: use of undeclared identifier 'LOCK_NB'
                 nonblk = LOCK_NB;
                          ^
flock.c:32:11: error: use of undeclared identifier 'LOCK_SH'
                 flags = LOCK_SH;
                         ^
flock.c:35:11: error: use of undeclared identifier 'LOCK_UN'
                 flags = LOCK_UN;
                         ^
flock.c:38:11: error: use of undeclared identifier 'LOCK_EX'
                 flags = LOCK_EX;
                         ^
flock.c:50:6: warning: implicit declaration of function 'flock' is
invalid in C99 [-Wimplicit-function-declaration]
         if (flock(fd, flags | nonblk)) {
             ^
join.c:323:13: warning: variable 'fileno' is used uninitialized whenever
'if' condition is false [-Wsometimes-uninitialized]
         } else if ((s[0] == '1' || s[0] == '2') && s[1] == '.') {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
join.c:331:15: note: uninitialized use occurs here
         sp->fileno = fileno;
                      ^~~~~~
join.c:323:9: note: remove the 'if' if its condition is always true
         } else if ((s[0] == '1' || s[0] == '2') && s[1] == '.') {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---blind errors---

src/stream.c:367:73: error: use of undeclared identifier 'MAP_ANONYMOUS'
         image = mmap(0, 2 * lframe_size + lframe_size, PROT_READ |
PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0);
^
Received on Mon Jan 29 2018 - 18:34:03 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 29 2018 - 18:36:33 CET