Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 340871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:39:23+00:00 2026-05-12T10:39:23+00:00

I’m using astyle which is great for applying standard style to existing code. However

  • 0

I’m using astyle which is great for applying standard style to existing code. However I’ve noticed that when it comes across this:

ostringstream myStream;
myStream << 1
         << 2;

it reformats to this:

ostringstream myStream;
myStream << 1
<< 2;

Here’s my options file: (version 1.23)

--indent=spaces
--brackets=break
--indent-switches
--indent-namespaces
--min-conditional-indent=4
--break-closing-brackets
--pad-paren-in
--unpad-paren
--convert-tabs

Is there any way to make it line up the “<<” on the next line?

Edit:

I also tried version 1.22 with the following file (test.cpp):

void main()
{
    ostringstream myStream;
    myStream << 1
             << 2;
}

with the following options (format.txt):

--indent=spaces
--brackets=break-closing
--indent-switches
--indent-namespaces
--min-conditional-indent=4
--pad=paren-in
--unpad=paren
--convert-tabs

and the following command line:

astyle –options=format.txt test.cpp

which produced this:

void main()
{
    ostringstream myStream;
    myStream << 1
    << 2;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:39:24+00:00Added an answer on May 12, 2026 at 10:39 am

    Final Conclusion is it’s a bug see bottom

    I tried to replicate your problem and was unable to get the behavior you are talking about (OP question update negates this)

    Edit: (deleted content to update)

    Parameter names have changed between 1.22 and 1.23.

    If neither solves your problem, try uploading more code as an example, or otherwise try to replicate your problem using only the code you pasted here. (Done by OP)

    I’ve also found that the order of the options seems to have made a difference on occasion. For example:

    astyle --indent=tab --style=ansi test.cpp
    

    is not the same as:

    astyle --style=ansi --indent=tab test.cpp
    

    Specifying the “–style=ansi” second effectively negates the “–indent=tab”.

    I would not be surprised if this might be your issue.

    …But after playing around with this for 20 min, I’m convinced it’s an astyle bug.

    Edit to include link to bug: bug Thanks Markh44

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 444k
  • Answers 444k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Take a look at the screencasts listed below from the… May 15, 2026 at 6:31 pm
  • Editorial Team
    Editorial Team added an answer The definition would be a very simple one-liner, but without… May 15, 2026 at 6:31 pm
  • Editorial Team
    Editorial Team added an answer The IPAddress property is a string[], so the following should… May 15, 2026 at 6:31 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.