[petsc-dev] Clang Analyzer

Lisandro Dalcin dalcinl at gmail.com
Mon Apr 13 02:50:38 CDT 2015


On 13 April 2015 at 03:13, Jed Brown <jed at jedbrown.org> wrote:
> Barry Smith <bsmith at mcs.anl.gov> 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



More information about the petsc-dev mailing list