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 8565471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:26:05+00:00 2026-06-11T17:26:05+00:00

I have function calls that look like this (for no apparent reason): func (

  • 0

I have function calls that look like this (for no apparent reason):

func
(
    a,
    b,
    c
)

Is there a way to make uncrustify collapse the function into a single line? I have been trying for two days not on and off…

I got it to work for function declarations, but I don’t get it to work for function calls.

While we are at it I also have functions that look like so:

func
(
    a, // (IN) the A
    b, // (IN) something b
    c  // (OUT) the resulting value
)

Is there a way to handle that case too, without breaking the code? Since uncrustify keeps comments, I think this is kind of impossible. With function declarations it collapses it to the first comment.

  • 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-06-11T17:26:06+00:00Added an answer on June 11, 2026 at 5:26 pm

    After some LOOONG research I have come to the conclusion, that uncrustify can’t do that. For my porposses I hacked a small perl script together:

    $filename = $ARGV[0];
    
    {
        open(FILE, "<", $filename) or die "Cant open $filename for reading\n";
        local $/ = undef;
        $lines = <FILE>;
        close(FILE);
    }
    
    # squash comments in function calls and declarations
    $lines =~ s/,[ \t]*\/\/[^\n\r]*/,/gm;
    # squash last comment in function calls and declarations
    $lines =~ s/[ \t]*\/\/[^\n\r]*\r\n[ \t]*\)/\)/gm;
    # squash newlines at the start of a function call or declaration
    $lines =~ s/\([ \t]*\r\n[ \t]*/\(/gm;
    # squash newlines in function calls and declarations
    $lines =~ s/,[ \t]*\r\n[ \t]*/, /gm;
    # squash the last newline in a function call or declaration
    $lines =~ s/[ \t]*\r\n[ \t]*\)/\)/gm;
    
    {
        open(FILE, ">", $filename) or die "Cant open $filename for writing\n";
        print FILE $lines;
        close(FILE);
    }
    

    I will look into if I can build a patch that integrates that feature into uncustify.

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

Sidebar

Related Questions

I have link that calls a function when clicked: <a href=javascript:spawnMenu(this); id=link1>Test1</a> To make
I have a javascript function that calls a generic function to make an ajax
I'd like to make a node.js function that, when calls, reads a file, and
I have a RIA Services data service that has several function calls that look
I have a function that calls out a read or write request on a
I have a function that calls itself to increment and decrement a stack. I
I have a function in my application that calls various subfunctions depending on the
I have a javascript that calls a function each 1 minute. That function sends
I have a simple recursive function RCompare() that calls a more complex function Compare()
I have created a function in PHP that calls a webservice and parses through

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.