about summary refs log tree commit diff
path: root/conform
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2021-08-27 17:47:46 +0000
committerJoseph Myers <joseph@codesourcery.com>2021-08-27 17:47:46 +0000
commit6090a4a1b32fd7859d0ad5b7e9b240bd5fa04b3f (patch)
tree31ca624c983e38d37d3f1b1771e9eb2ee08bd469 /conform
parent6f4973c1a2449438840a838732052e029fbea737 (diff)
downloadglibc-6090a4a1b32fd7859d0ad5b7e9b240bd5fa04b3f.tar.gz
glibc-6090a4a1b32fd7859d0ad5b7e9b240bd5fa04b3f.tar.xz
glibc-6090a4a1b32fd7859d0ad5b7e9b240bd5fa04b3f.zip
Allow #pragma GCC in headers in conformtest
No "#pragma GCC" pragma allows macro-expansion of its arguments, so no
namespace issues arise from use of such pragmas in installed headers.
Ignore them in conformtest tests of header namespace.

Tested for x86_64, in conjunction with Paul's patch
<https://sourceware.org/pipermail/libc-alpha/2021-August/130571.html>
adding use of such pragmas to installed headers shared with gnulib.
Diffstat (limited to 'conform')
-rw-r--r--conform/conformtest.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/conform/conformtest.py b/conform/conformtest.py
index f0405b7186..b0ec8e7ed1 100644
--- a/conform/conformtest.py
+++ b/conform/conformtest.py
@@ -624,6 +624,14 @@ class HeaderTests(object):
                     continue
                 if re.match(r'# [1-9]', line):
                     continue
+                if line.startswith('#pragma GCC '):
+                    # No GCC pragma uses macro expansion, so no
+                    # namespace issues arise from such pragmas.  (Some
+                    # pragmas not in the GCC namespace do macro-expand
+                    # their arguments and so could be affected by
+                    # macros defined by user code including the
+                    # header.)
+                    continue
                 match = re.match(r'#define (.*)', line)
                 if match:
                     self.check_token(bad_tokens, match.group(1))