public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/release/2.34/master] Allow #pragma GCC in headers in conformtest
@ 2022-11-11 16:28 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2022-11-11 16:28 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=291d4402067760edb7c0f339f9e451787a25e20a

commit 291d4402067760edb7c0f339f9e451787a25e20a
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Aug 27 17:47:46 2021 +0000

    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.
    
    (cherry picked from commit 6090a4a1b32fd7859d0ad5b7e9b240bd5fa04b3f)

Diff:
---
 conform/conformtest.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/conform/conformtest.py b/conform/conformtest.py
index 4898e16c9f..164cf2917d 100644
--- a/conform/conformtest.py
+++ b/conform/conformtest.py
@@ -631,6 +631,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))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-11 16:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11 16:28 [glibc/release/2.34/master] Allow #pragma GCC in headers in conformtest Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).