bugGNU indent - Bugs: bug #42357, option to keep short if statements...

 
 

bug #42357: option to keep short if statements or loops on a single line

Submitter:  None
Submitted:  Wed 14 May 2014 01:38:34 PM UTC
   
 
Category:  C Severity:  3 - Normal
Item Group:  Wishlist Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 17 Sep 2018 03:38:42 PM UTC, comment #1: 

This has been implemented in 2.2.12 via the -slc --single-line-conditionals option.

https://savannah.gnu.org/forum/forum.php?forum_id=9233

Chris Merck <chrismerck>
Wed 14 May 2014 01:38:34 PM UTC, original submission:  

That is, keep the following on a single line if feasible:

 if (a) return;
 while (true) continue;

Note: I don't personally like this option much (and it's very anti-1TBS, for which I just submitted a wishlist item: http://savannah.gnu.org/bugs/?42355) but I thought that for feature parity with clang-format:

http://clang.llvm.org/docs/ClangFormatStyleOptions.html
search for AllowShortIfStatementsOnASingleLine and AllowShortLoopsOnASingleLine

these would be nice to include.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chrismerck (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code