[03/17] Regex: Bracket call to __libc_lock_define inside ifdef.
Commit Message
This patch brackets a call to __libc_lock_define inside the correct ifdef.
2017-11-27 Arnold D. Robbins <arnold@skeeve.com>
* posix/regex_internal.h (re_dfa_t): Bracket call to
__libc_lock_define insidef ifdef _LIBC.
Comments
On 12/08/2017 01:16 AM, Arnold Robbins wrote:
> This patch brackets a call to __libc_lock_define inside the correct ifdef.
>
> 2017-11-27 Arnold D. Robbins <arnold@skeeve.com>
>
> * posix/regex_internal.h (re_dfa_t): Bracket call to
> __libc_lock_define insidef ifdef _LIBC.
>
The commit message should explain the actual problem here, which is that
the current code passes an empty argument to a macro, and this does not
conform to C89 and some older compilers reject it. Also, the change
should remove the now-unused #define for __libc_lock_define when _LIBC
is not defined. In short, I suggest something like the following change
instead:
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=3ccb7f0727c5154ee91609f30b0fb62b94142c10
This is already in Gnulib.
@@ -639,7 +639,9 @@ struct re_dfa_t
#ifdef DEBUG
char* re_str;
#endif
+#if defined _LIBC
__libc_lock_define (, lock)
+#endif
};
#define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))