From: Joseph Myers Date: Fri, 27 Aug 2021 17:47:46 +0000 (+0000) Subject: Allow #pragma GCC in headers in conformtest X-Git-Tag: glibc-2.35~553 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6090a4a1b32fd7859d0ad5b7e9b240bd5fa04b3f;p=thirdparty%2Fglibc.git 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 adding use of such pragmas to installed headers shared with gnulib. --- diff --git a/conform/conformtest.py b/conform/conformtest.py index f0405b71869..b0ec8e7ed17 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))