User forums > Nightly builds

The 01 March 2017 build (11021) is out.

<< < (4/7) > >>

Kilmatead:
The new version of the code formatter seems to have trouble with ternary operators - any time it encounters one (even something simple like 'i ? 1 : 0' it throws an assertion:


--- Quote ---File: C:\CodeBlocks\sf2\src\plugins\ast...\ASForematter.cpp
Line: 3229

Expression: currentChar == '+' || currentChar == '-'
--- End quote ---

Swapping out the astyle.dll for an older version solves it.

oBFusCATed:
Kilmatead: Can you post the full stacktrace or a minimal sample and steps to reproduce?

Kilmatead:
Reproducing is easy (at least for me, Win7 x64)... thinking it might be some conflict of settings, I removed the %appdata% codeblocks user-settings and tried it stock and the same thing happens every time.

So, just open CB (preferably at stock), use File -> New -> Empty File and type a nonsense line like:


--- Code: ---int i = 1 ? 0 : 0;
--- End code ---

Then hit Plugins -> Source Code Formatter, and I immediately get the same broken assertion every time.  If I remove the ternary, then astyle formats just fine.  Changing settings in astyle makes no difference, it seems to happen for all styles/options (in this latest version - like I said, DLL's for astyle from previous nightlies work fine).

I first discovered this on a larger project, and narrowed it down to always (and only) happening on lines containing a ?: ternary.

As an extra added bonus, when used with stock settings CB itself crashes, no matter which option is chosen.  Under my usual setup I could at least 'Ignore' it and continue.

stahta01:
To expand on Kilmatead issue.

I reproduced it on Windows 10 32 bit.


--- Code: ---#include <iostream>

using namespace std;

int main()
{
    int i = 1 ? 0 : 0;

    cout << "Hello world!" << endl;
    return 0;
}

--- End code ---

Attched crash report.

Tim S.


Jenna:
I can easily reproduce it here on Linux also.
It crashes in the version from my copr-repo (latest trunk) and on F26 with C::B 16.01 linked again system-astyle.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version