diff mbox series

undefine OFFSET in testsuite/gcc.dg/vect/tree-vect.h

Message ID 2C125A4A-EBA5-4F14-A1A7-9A5A5A8AAEBA@adacore.com
State New
Headers show
Series undefine OFFSET in testsuite/gcc.dg/vect/tree-vect.h | expand

Commit Message

Olivier Hainque Dec. 20, 2019, 6:11 p.m. UTC
Hello,

The attached patch is a proposal for a basic solution
to an issue which might be an improper thing done by a
system header on VxWorks, but which is a big pain to fix
at this level and very simple to address super locally.

A number of tests based on gcc.dg/vect/tree-vect.h
#define and then use a macro named OFFSET, which conflicts
with a macro of the same name exposed by a system
header on VxWorks.

The patch proposed here simply #undef's OFFSET from
tree-vect.h to prevent the possible conflict.

Is this OK to commit ?

Thanks a lot in advance,

With Kind Regards,

Olivier

2019-12-20  Olivier Hainque  <hainque@adacore.com>

	testsuite/
	* gcc.dg/vect/tree-vect.h: #undef OFFSET.
gcc/testsuite/gcc.dg/vect/tree-vect.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Mike Stump Dec. 21, 2019, 1:39 a.m. UTC | #1
On Dec 20, 2019, at 10:11 AM, Olivier Hainque <hainque@adacore.com> wrote:
> 
> The attached patch is a proposal for a basic solution
> to an issue which might be an improper thing done by a
> system header on VxWorks, but which is a big pain to fix
> at this level and very simple to address super locally.

> Is this OK to commit ?

Ok, but I will comment it would be much better to fix includes the header to be namespace clean, longer run.  I know why that probably won't work, but I'll mention it anyway.  If fixincluding the header works better than I expect, please do that fix instead.
Olivier Hainque Dec. 22, 2019, 10:47 p.m. UTC | #2
> On 21 Dec 2019, at 02:39, Mike Stump <mikestump@comcast.net> wrote:
> 
> On Dec 20, 2019, at 10:11 AM, Olivier Hainque <hainque@adacore.com> wrote:
>> 
>> The attached patch is a proposal for a basic solution
>> to an issue which might be an improper thing done by a
>> system header on VxWorks, but which is a big pain to fix
>> at this level and very simple to address super locally.
> 
>> Is this OK to commit ?
> 
> Ok, but I will comment it would be much better to fix includes the header to be namespace clean, longer run.  I know why that probably won't work, but I'll mention it anyway.  If fixincluding the header works better than I expect, please do that fix instead.

Thanks for your reviews and feedback Mike. Always glad to receive
experts' comments :)

Yes, fixincludes is something we have considered and will reconsider
at some point. We have made progress for Vx6 but we're still not
ready for Vx7, where custom OS install are made for every project
(notion of VSB), so there are compromises to make on which we're
still not clear how to settle.

Besides, this particular fix would be pretty invasive as the
problematic definition is exposed by a common header (vxWorksCommon.h)
for use by potentially any other system header.

Olivier
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/vect/tree-vect.h b/gcc/testsuite/gcc.dg/vect/tree-vect.h
index 69c93ac8092..5d8d9eba3f8 100644
--- a/gcc/testsuite/gcc.dg/vect/tree-vect.h
+++ b/gcc/testsuite/gcc.dg/vect/tree-vect.h
@@ -85,3 +85,9 @@  check_vect (void)
 #else
 #  define VECTOR_BITS 128
 #endif
+
+/* Which most of our tests are going to #define for internal use, and
+   which might be exposed by system headers related to signal.h on some
+   targets, notably VxWorks.  */
+#undef OFFSET
+