Jed, hold on. I think this will not work. Does GCC or other compilers that do support __attribute__((something)) have support for __has_attribute(something) ?
For now, I'll only add the bits required for getting clang analyzer happy. On 13 April 2015 at 10:50, Lisandro Dalcin <[email protected]> wrote: > On 13 April 2015 at 03:13, Jed Brown <[email protected]> wrote: >> Barry Smith <[email protected]> writes: >> >>> Lisandro, >>> >>> More code analysis is always good. We'll figure something out for this >>> particular beast. Note that petscsys.h already uses #if >>> defined(__has_attribute) so maybe we can use >>> >>> #if defined(__has_attribute) >>> # if __has_attribute(analyzer_noreturn) >>> >>> instead of the #ifdef __clang_analyzer__? >> >> Should we add a PETSC_HAS_ATTRIBUTE(analyzer_noreturn) to make this less >> verbose? (It would return 0 if __has_attribute is not available.) I >> foresee more use of __has_attribute to reduce the number of tests we >> have to run and make petscconf.h more robust to, e.g., minor version >> changes in the compiler stack. > > Yes, of course, this is much better. I guess petscsys.h is the right > place to add this logic. I'll put this together in a PR. > > > -- > Lisandro Dalcin > ============ > Research Scientist > Computer, Electrical and Mathematical Sciences & Engineering (CEMSE) > Numerical Porous Media Center (NumPor) > King Abdullah University of Science and Technology (KAUST) > http://numpor.kaust.edu.sa/ > > 4700 King Abdullah University of Science and Technology > al-Khawarizmi Bldg (Bldg 1), Office # 4332 > Thuwal 23955-6900, Kingdom of Saudi Arabia > http://www.kaust.edu.sa > > Office Phone: +966 12 808-0459 -- Lisandro Dalcin ============ Research Scientist Computer, Electrical and Mathematical Sciences & Engineering (CEMSE) Numerical Porous Media Center (NumPor) King Abdullah University of Science and Technology (KAUST) http://numpor.kaust.edu.sa/ 4700 King Abdullah University of Science and Technology al-Khawarizmi Bldg (Bldg 1), Office # 4332 Thuwal 23955-6900, Kingdom of Saudi Arabia http://www.kaust.edu.sa Office Phone: +966 12 808-0459
