astyle formatter breaks the specific code in a very bad way

Bug #1049606 reported by Artur R. Czechowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
astyle
Unknown
Unknown
astyle (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Description: Ubuntu 12.04 LTS
Release: 12.04

astyle:
  Installed: 2.01-1

Pass the code:

void foo() {
    if (a < b) dst[c] = (d >> e ) & 0xF;
}

through astyle -j . The result is:

void foo() {
    if (a < b) dst[c] = (d >> e ) {
        & 0xF;
    }
}

The expected result shall be:
void foo() {
    if(a<b) {
        dst[c] = (d >> e ) & 0xF;
    }
}

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: astyle 2.01-1
ProcVersionSignature: Ubuntu 3.2.0-29.46-generic 3.2.24
Uname: Linux 3.2.0-29-generic x86_64
ApportVersion: 2.0.1-0ubuntu13
Architecture: amd64
Date: Wed Sep 12 12:48:52 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
ProcEnviron:
 TERM=xterm
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: astyle
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Artur R. Czechowski (arturcz) wrote :
Revision history for this message
Artur R. Czechowski (arturcz) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package astyle - 2.03-1

---------------
astyle (2.03-1) unstable; urgency=low

  * New upstream release. (Closes: #707889, #631966, LP: #1049606)
  * Update manpage.

 -- Matteo Cypriani <email address hidden> Wed, 15 May 2013 00:10:00 -0400

Changed in astyle (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.