Menu ▾ ▴

#557 Output for C-style cast changes constantly

closed-fixed
None
2023-10-18
2023-10-13
Bela Szabo
No

I've encountered a problem today with the latest version (3.4.8) on Windows. The output for C-style casts in a function call in C/C++ code alternates constantly between two consecutive runs. The problem can be reproduced with this small snippet:

#pragma once

void testMethod()
{
    if (anotherMethod((uint8_t*)param1, (uint8_t*)param2)) {
        return;
    }
}

If I run astyle for this code a space will be added to the casts between the type and the asterisk:

#pragma once

void testMethod()
{
    if (anotherMethod((uint8_t *)param1, (uint8_t *)param2)) {
        return;
    }
}

If I rerun it the space will be removed, and so on. I've attached the options file.

Background: we've been using Astyle 3.1 for 3 years now on Linux. Now we are porting our development to Windows, for which I downloaded the latest version, that generates this frustrating issue. This makes it unusable for us, as files are constantly shown as changed in git.
As a quick fix I've downloaded version 3.1 for Windows, and I could not reproduce the bug with it.

1 Attachments

Discussion

  • André Simon

    André Simon - 2023-10-16
    • status: open --> open-accepted
    • assigned_to: André Simon
     
  • André Simon

    André Simon - 2023-10-16

    Thanks for reporting, the issue is fixed in the git repo. New release will be published soon.

     
  • André Simon

    André Simon - 2023-10-18
    • status: open-accepted --> closed-fixed
     
  • André Simon

    André Simon - 2023-10-18

    Fixed in 3.4.9.

     

Log in to post a comment.