source: libcfa/src/stdhdr/pthread.h @ 5f210c0

Last change on this file since 5f210c0 was 85a2c3f, checked in by Peter A. Buhr <pabuhr@…>, 3 years ago

workaround for gcc-11 bug with spurious array-parameter warning

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[95958a8]1//
2// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// pthread.h --
8//
9// Author           : Peter A. Buhr
10// Created On       : Wed Jun 16 13:39:06 2021
11// Last Modified By : Peter A. Buhr
[85a2c3f]12// Last Modified On : Thu Feb  3 21:53:26 2022
13// Update Count     : 13
[95958a8]14//
15
[85a2c3f]16// pthread.h and setjmp.h cannot agree on the type of __sigsetjmp:
17//
18//   extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__));
19//   extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __attribute__ ((__nothrow__));
20//
21// With -Wall, gcc-11 warns about the disagreement unless the CPP directive
22//
23//    # 1 "/usr/include/pthread.h" 1 3 4
24//
25// appears, which appears to be witchcraft. Unfortunately, this directive is removed by the CFA preprocessor, so the
26// batchtest fails because of the spurious warning message. Hence, the warning is elided.
27
[95958a8]28extern "C" {
[85a2c3f]29#if defined(__GNUC__) && __GNUC__ == 11
30        #pragma GCC diagnostic push
31        #pragma GCC diagnostic ignored "-Warray-parameter"
32#endif // defined(__GNUC__) && __GNUC__ == 11
33
[95958a8]34#include_next <pthread.h>                                                               // has internal check for multiple expansion
[85a2c3f]35
36#if defined(__GNUC__) && __GNUC__ == 11
37        #pragma GCC diagnostic pop
38#endif // defined(__GNUC__) && __GNUC__ == 11
[95958a8]39} // extern "C"
40
41// Local Variables: //
42// mode: c++ //
43// End: //
Note: See TracBrowser for help on using the repository browser.