[libstdc++,testsuite] intro/names.cc: undef func on vxw7krn

Message ID ormt5cu86w.fsf@lxoliva.fsfla.org
State Accepted
Headers
Series [libstdc++,testsuite] intro/names.cc: undef func on vxw7krn |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Alexandre Oliva Feb. 17, 2023, 6:17 a.m. UTC
  The '#define func' added in 2021, to test that system headers don't
violate the user namespace, exposes such a bug in the vxworks sysLib.h
header, so add yet another such annotated workaround.

Regstrapped on x86_64-linux-gnu.
Tested on arm-vxworks7 (gcc-12) and arm-eabi (trunk).  Ok to install?

for  libstdc++-v3/ChangeLog

	* testsuite/17_intro/names.cc: Undef func on vxworks >= 7 in
	kernel mode.
---
 libstdc++-v3/testsuite/17_intro/names.cc |    2 ++
 1 file changed, 2 insertions(+)
  

Comments

Jonathan Wakely Feb. 17, 2023, 10:59 a.m. UTC | #1
On Fri, 17 Feb 2023, 06:19 Alexandre Oliva via Libstdc++, <
libstdc++@gcc.gnu.org> wrote:

>
> The '#define func' added in 2021, to test that system headers don't
> violate the user namespace, exposes such a bug in the vxworks sysLib.h
> header, so add yet another such annotated workaround.
>
> Regstrapped on x86_64-linux-gnu.
> Tested on arm-vxworks7 (gcc-12) and arm-eabi (trunk).  Ok to install?
>

OK, thanks.



> for  libstdc++-v3/ChangeLog
>
>         * testsuite/17_intro/names.cc: Undef func on vxworks >= 7 in
>         kernel mode.
> ---
>  libstdc++-v3/testsuite/17_intro/names.cc |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libstdc++-v3/testsuite/17_intro/names.cc
> b/libstdc++-v3/testsuite/17_intro/names.cc
> index d3e0db9bab6b9..c2d67ebe01276 100644
> --- a/libstdc++-v3/testsuite/17_intro/names.cc
> +++ b/libstdc++-v3/testsuite/17_intro/names.cc
> @@ -329,6 +329,8 @@
>  #undef d
>  #undef e
>  #undef f
> +// in sysLib.h, func appears as a formal parameter name
> +#undef func
>  #endif // __RTP__
>
>  #endif // VxWorks Major >= 7
>
> --
> Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
>    Free Software Activist                       GNU Toolchain Engineer
> Disinformation flourishes because many people care deeply about injustice
> but very few check the facts.  Ask me about <https://stallmansupport.org>
>
  

Patch

diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc
index d3e0db9bab6b9..c2d67ebe01276 100644
--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -329,6 +329,8 @@ 
 #undef d
 #undef e
 #undef f
+// in sysLib.h, func appears as a formal parameter name
+#undef func
 #endif // __RTP__
 
 #endif // VxWorks Major >= 7