[v1] Replace __restrict with __restrict_arr in regex.h

Message ID 20240829030804.30608-1-gaoshanliukou@163.com
State New
Headers
Series [v1] Replace __restrict with __restrict_arr in regex.h |

Commit Message

yang.zhang Aug. 29, 2024, 3:08 a.m. UTC
  From: "yang.zhang" <zhangyang01@kylinos.cn>

when a C++ source file include this header file, it would build fail.

Signed-off-by: yang.zhang <zhangyang01@kylinos.cn>
---
Such as i build libgest, which would include regex.h, then it build fail.
The failure is relate to commit 3c75fac130b5.

In file included from ../../../cpukit/libgtest/googletest/googletest/include/gtest/internal/gtest-port.h:451,
                 from ../../../cpukit/libgtest/googletest/googletest/include/gtest/internal/gtest-internal.h:39,
                 from ../../../cpukit/libgtest/googletest/googletest/include/gtest/gtest.h:58,
                 from ../../../cpukit/libgtest/googletest/googletest/src/gtest-all.cc:39:
/home/yangzhang/software/toolchain/toolchain/aarch64-rtems6/include/regex.h:99:45: error: expected primary-expression before '__restrict'
   99 |                         size_t, regmatch_t [__restrict], int);

Signed-off-by: yang.zhang <zhangyang01@kylinos.cn>
---
 newlib/libc/include/regex.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Corinna Vinschen Sept. 2, 2024, 8:29 p.m. UTC | #1
On Aug 29 11:08, yang.zhang wrote:
> From: "yang.zhang" <zhangyang01@kylinos.cn>
> 
> when a C++ source file include this header file, it would build fail.
> 
> Signed-off-by: yang.zhang <zhangyang01@kylinos.cn>
> ---
> Such as i build libgest, which would include regex.h, then it build fail.
> The failure is relate to commit 3c75fac130b5.
> 
> In file included from ../../../cpukit/libgtest/googletest/googletest/include/gtest/internal/gtest-port.h:451,
>                  from ../../../cpukit/libgtest/googletest/googletest/include/gtest/internal/gtest-internal.h:39,
>                  from ../../../cpukit/libgtest/googletest/googletest/include/gtest/gtest.h:58,
>                  from ../../../cpukit/libgtest/googletest/googletest/src/gtest-all.cc:39:
> /home/yangzhang/software/toolchain/toolchain/aarch64-rtems6/include/regex.h:99:45: error: expected primary-expression before '__restrict'
>    99 |                         size_t, regmatch_t [__restrict], int);
> 
> Signed-off-by: yang.zhang <zhangyang01@kylinos.cn>
> ---
>  newlib/libc/include/regex.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Pushed.

Thanks,
Corinna
  

Patch

diff --git a/newlib/libc/include/regex.h b/newlib/libc/include/regex.h
index fa3e26879..4da1a374e 100644
--- a/newlib/libc/include/regex.h
+++ b/newlib/libc/include/regex.h
@@ -96,7 +96,7 @@  __BEGIN_DECLS
 int	regcomp(regex_t *__restrict, const char *__restrict, int);
 size_t	regerror(int, const regex_t *__restrict, char *__restrict, size_t);
 int	regexec(const regex_t *__restrict, const char *__restrict,
-			size_t, regmatch_t [__restrict], int);
+			size_t, regmatch_t [__restrict_arr], int);
 void	regfree(regex_t *);
 __END_DECLS