[libcxx-commits] [clang] [libcxx] [clang] Enable GNU __attribute__((init_priority(...))) on z/OS. (PR #199573)

Sean Perry via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 27 07:57:56 PDT 2026


================
@@ -28,42 +26,27 @@ extern Two koo[];
 // unknown-system-no-diagnostics
 
 Two foo __attribute__((init_priority(101))) ( 5, 6 );
-// unknown-warning at -1 {{unknown attribute 'init_priority' ignored}}
-
-Two loo __attribute__((init_priority(65535))) ( 5, 6 );
-// unknown-warning at -1 {{unknown attribute 'init_priority' ignored}}
 
 Two goo __attribute__((init_priority(2,3))) ( 5, 6 ); // expected-error {{'init_priority' attribute takes one argument}}
-// unknown-warning at -1 {{unknown attribute 'init_priority' ignored}}
 
 Two coo[2]  __attribute__((init_priority(100)));
-#if !defined(SYSTEM)
-#if !defined(NOERROR)
-  // expected-error at -3 {{requested 'init_priority' 100 is reserved for internal use}}
-#else  // defined(NOERROR)
-  // expected-warning at -5 {{requested 'init_priority' 100 is reserved for internal use}}
-#endif // !defined(NOERROR)
-  // unknown-warning at -7 {{unknown attribute 'init_priority' ignored}}
-#endif // !defined(SYSTEM)
-
+#if defined(NOERROR)
----------------
perry-ca wrote:

sorry one more comment.  Now that these are together I see a change in logic.  Can you fix this up to match the original code.  I think you just need to remove the old line 46.

I don't really understand the purpose of the `-DSYSTEM` check since that doesn't change any other command line options.  Won't that test just result in an unexpected error being reported?

https://github.com/llvm/llvm-project/pull/199573


More information about the libcxx-commits mailing list