[petsc-dev] Style Guide: How to format single-line if/for/while-blocks?

Barry Smith bsmith at mcs.anl.gov
Mon Jan 21 22:34:28 CST 2013


On Jan 21, 2013, at 10:31 PM, Karl Rupp <rupp at mcs.anl.gov> wrote:

> Hi Barry,
> 
> 
>>>> Well I think it is insane in 2012 that we all need to stare at the exact same ASCII strings with the exact same placement (each of you thinks is wrong) when we develop shared code, so please teach me how. Can this be done through some bridge that uses the current hg PETSc repository?
>>> 
>>> Yeah, even in *2013* it feels so wrong.
>>> I'll see whether I can use Clang to provide this bridge.
>> 
>>    Please do, don't take my previous email attacking the Clang pretty printers too seriously, perhaps your keen eye can figure out how to get them to do everything we'd like to have.
> 
> Will do.
> 
> 
>>>>    Unfortunately the CPP crap in PETSc messes things up a bit, curse that CPP wish we could eliminate it all. And yes CPP is C preprocessor not C++.
>>> 
>>> Does it? For the formatting itself it's just another layer…
>> 
>>   Yes but it doesn't fit into the C AST.
> 
> If I'm not mistaken, one can attach a preprocessor to a compiler object and generate some kind of syntax tree as well as a full C AST. This allows some additional back-and-forth operations.

   There is the theory, and then there is the practice :-(

   Barry

> 
> Best regards,
> Karli
> 




More information about the petsc-dev mailing list