CLion starts 2018.1 EAP: WSL support, C++17 if with initializer, CMake and project view changes

Hi all,

We are back from our holidays, and it’s time to start CLion 2018.1 EAP!
CLion_2018_1_EAP_blog@2x

Our plans for this release are really promising and today we are happy to present to you a couple of great new additions to CLion:

Download CLion 2018.1 EAP

Continue reading

Posted in Announcement, Early Access Preview | Tagged , , , , , | 23 Comments

Tell us about your embedded dev and win a prize!

Before we embarked on creating CLion, we ran a full-blown C++ market research study. This study revealed that embedded development was one of the top 3 markets that required the C++ language (with the other two being finance, including market trading, and game development). Based on this insight, we’ve always considered embedded development a priority for CLion.

20170220-Newsletter

However, until recently we haven’t been able to devote as many resources to this area as it deserves, as we’ve been busy creating the general and common features and improvements in CLion. Luckily, some of our customers have already had success in adapting CLion for embedded development on their own. A great example of such an effort is a plugin by Ilya Motornyy. In his two guest blog posts, he describes how it can be used to program for microcontrollers in CLion:

This year, we are going to get down to embedded. We are already collecting market research information, and this is where we need your help!

We’ve prepared a survey to learn more about how you do embedded development, what tools you use, what your needs and pains points are, and how we can help. Share your experience with us and get a chance to win a $50 Amazon certificate!

Complete the survey!

Your CLion Team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , , | Leave a comment

CLion 2018.1 EAP: Clang-Tidy options and configs, CMake Install and more

Hi,

The new CLion 2018.1 EAP, build 181.3741.16, is available for download. This build delivers more flexible configuration of Clang-Tidy, fixes for debugger on WSL, CMake Install, dozens of GDB fixes and color schemes improvements.

If you have the previous CLion 2018.1 EAP build (181.3494.7) installed, you should soon get a notification in the IDE about a patch update.

Download CLion 2018.1 EAP

Clang-Tidy options

Starting with v2017.2 CLion comes with an integration with Clang-Tidy, which expands the list of CLion’s built-in checks and helps you ensure better code quality. Clang-Tidy checks can be configured in CLion’s settings (Settings/Preferences | Editor | Inspections | C/C++ | General | Clang-Tidy). With CLion 2018.1 EAP you can also:

  • Configure options used by the Clang-Tidy checks
  • Force CLion to use existing .clang-tidy configs instead of the settings provided in the IDE settings dialog

For example, if you take modernize-use-nullptr check and decide to provide the list of macro names that will be transformed into C++11 nullptr, you can configure this list in CLion now:
clang_tidy_options
If you want CLion to respect your existing per-directory Clang-Tidy configs, untick “Use IDE settings” option under Settings/Preferences | Editor | Inspections | C/C++ | General | Clang-Tidy.

The bundled Clang-Tidy binary was updated and now provides more checks (CPP-11811).

WSL debugger

WSL support in CLion comes with the debugger. This EAP build fixes an issue with reading from std::cin. Besides, you don’t need to enable WSL debugger via Registry now – it’s on by default.
Continue reading

Posted in Early Access Preview | Tagged , , , , , , | 18 Comments

CLion 2018.1 EAP: Messages tool window and fixes for ternary operator

Hi,

A new CLion 2018.1 EAP build (181.3494.7) is available for download. As usual, no license is required for this build, and you can install it side by side with your stable CLion version.

Download CLion 2018.1 EAP

Messages tool window

The general idea behind the change is to make Messages tool window behaviour more flexible and let users decide if the build output is always necessary (and thus should be visible) or it’s only needed if some warnings or errors appear. In the Messages tool window settings you can find two options:

  • Always show on Build: default setting, forces the Messages tool window to stay opened on every build (and open the window if it was closed explicitly).
  • Auto-Hide and Show on Warning/Error: forces to hide Messages tool window on each build if it was opened, then opens it back if warning/error occurs during the compilation, and leaves Messages closed if the build was successful.

If you disable both options, then CLion won’t open Messages tool window unless there’s a warning/error. Thus, if you open/close Messages tool window manually, it will stay in that position.
messages_window

C++ language support improvements

A bunch of false positives in code analysis related to ternary operator was fixed in this build:

  • Using format specifier ‘%s’ with conditional operator argument results in bogus warnings (CPP-1450)
  • Red code in ternary + new operator (CPP-9526)
  • False positive if std::out is used in the ternary operator (CPP-11499)
  • Initializing a reference from a ternary operator tries to use a constructor (CPP-9889)
  • Wrong “Types are not compatible” error reporting when using function and function pointer in a ternary operator (CPP-7404)
  • The type of ternary operator with “int *” is inferred incorrectly (CPP-3260)
  • And some more

Besides, this build addresses a few UI freezes. Full release notes are available by the link.

Your CLion Team
JetBrains
The Drive to Develop

Posted in Early Access Preview | Tagged , , | 11 Comments

CLion 2018.1 EAP: debug on WSL, code folding of the control statements and more

Hi all,

Last week we started CLion 2018.1 EAP. And now it’s time to announce a new build (181.3263.17). No license is required for this build, and you can install it side by side with your stable CLion version.

Download CLion 2018.1 EAP

Debug on WSL

Last time we announced WSL support in CLion, which is an opportunity to use native Linux development toolchain (CMake, C and C++ compilers) when developing on Windows. And now debug on WSL is available! There are some known issues and limitations, so it’s only available under the Registry option for now: cidr.wsl.enableGDB.

In Find Action dialog (Shift+Ctrl+A on Linux/Windows, ⇧⌘A on macOS) type Registry; open Registry, type cidr.wsl.enableGDB (or just wsl) to search for the setting and turn it on. Check the WSL debugger is now available for you in the WSL toolchain:
WSL_debugger

When you debug your program, it will be run on WSL subsystem with WSL debugger (via the ssh connection).

Known issues and limitations:

  • Run to cursor doesn’t work with WSL (CPP-11902)

Code folding of the control statements

Control statements (if/else, do/while, for, switch) can now be folded/expanded via Shift+Ctrl+Period/Ctrl+= on Linux/Windows and ⇧⌘./⌘+ on macOS. It works for any block with more than one line of code or any block inside the braces:
Fold statement

And more

Other fixes and improvements include:

  • Incorrect unreachable code inspection for the catch section of function-level try-catch block is fixed(CPP-3094)
  • When analysing try section in the try-catch block, DFA now takes into account that dynamic_cast, new and overloaded operators can throw exceptions (CPP-11594)
  • An ability to use existing $VAR values when specifying environment variables for CMake is added (CPP-3716)
  • Some performance improvements when including a file via the code completion

Full release notes are available by the link.

Download the build (or wait for a patch update in case you are using previous EAP build), check the improvements and let us know your feedback.

CLion 2017.3.3 bug-fix update

We also are happy to announce another bug-fix update for v2017.3 – CLion 2017.3.3 (build 173.4548.31). It includes the fix for the regression with K&R functions (CPP-6702) and some IntelliJ-platform fixes. Full release notes are available here. Patch update is available from CLion 2017.3.2.

Your CLion Team
JetBrains
The Drive to Develop

Posted in Early Access Preview | Tagged , , , | 25 Comments

CLion and Linux toolchain on Windows are now friends!

In this post we’ll discuss how to work with WSL in CLion and how Windows users can benefit from this support.

Why do I need it?

CLion is a cross-platform IDE, that means you can run it on Windows, Linux, and macOS. From the very beginning it works with GCC and Clang compilers, which means on Windows it requires Cygwin or MinGW (or MinGW-w64). Later we introduced Microsoft Visual C++ compiler support, for those users who have it installed and want to use inside CLion on Windows.

Besides, we know that there are C++ developers who have Windows desktops but require Linux toolchain for building their projects. Cygwin could be a work-around. With Windows 10 Microsoft however introduced an even better way – Windows Subsystem for Linux. You simply get the prefered Linux distribution (Ubuntu, OpenSUSE and SLES are supported), configure the WSL and enjoy your new Linux environment in Windows. And now you can benefit from it in CLion!

That means the following is possible:

  • Configure WSL toolchains in CLion on Windows
  • Use CMake, C, and C++ compilers from Linux in CLion running on your Windows machine
  • Debugger support is available with limitations

Continue reading

Posted in Announcement, Early Access Preview, Tips'n'Tricks | Tagged , , , , , | 6 Comments

CLion 2017.3.2 bug-fix update

CLion 2017.3.2, build 173.4301.33, is now available for download. If you’re using CLion 2017.3.1, a patch-update will be available shortly.


Download CLion 2017.3.2

In this update:

  • Ability to pause program output in the terminal (IDEA-140061). This can help when scrolling the output back while the program is still running and producing new lines to the output.
  • Fix for the bundled GDB 8.0 crash on Linux when debugging certain inferiors (CPP-11480).

Full release notes are available by the link.

Your CLion Team

JetBrains
The Drive to Develop

Posted in Announcement | Tagged , | 9 Comments

CLion 2017.3.1 update is available

CLion 2017.3.1, build 173.4127.32, is now available for download. If you’re using CLion 2017.3 or CLion 2017.3.1 EAP, a patch-update will be available shortly.

If you haven’t yet upgraded to CLion 2017.3, good time to do so right now!


Download CLion 2017.3.1

This bug fix update:

  • Brings Catch 2 support
  • Updates bundled CMake to v3.9.6
  • Makes Generate function from usage respect template parameters
  • Fixes a couple of regressions in C++ parser

More details can be found here and the full release notes are available by the link.

Ubuntu users can get this update via snaps:
$sudo snap install clion --classic

Your CLion Team

JetBrains
The Drive to Develop

Posted in Announcement | Tagged , | 1 Comment

C++ Annotated: Sep – Dec 2017

Today we are happy to share our next compilation of C++ news with you.

Subscribe to the regular C++ Annotated and be the first to get the next edition!

C++ Annotated: September – December 2017

This last part of the year 2017 has been full of great conferences and meetups, hot discussions in the committee on C++20, interesting articles, and big releases. And, of course, the biggest news – C++17 is now officially signed and published! 🎉

In this edition:

Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

CLion for Embedded Development Part II

Hi,

This is a second guest blog post by Ilya Motornyy about programming for microcontrollers in CLion.

CLion for Embedded Development Part I

Upd. An alternative approach from Klaus Nagel in a small demo project on GitHub: Embedded Development on STM32 with CLion and the Segger Tools.

Tell us about your embedded dev and win a prize!

Ilya Motornyy
Ilya Motornyy

Java/JavaScript Developer at Vaadin.com
DIY Electronics and Embedded Programming Enthusiast

History

About one and a half years ago I wrote a blog post about using CLion for embedded software development. Long story short, I used an ST demo board (reflashed into SEGGER JLink-compatible probe), STM32CubeMX code generator, GCC ARM toolchain, and SEGGER Ozone on-chip debugger to run some demonstration project. That combo seems to be a working solution, but, on the other hand, there were some complications with the re-flashing probe, with running an external debugger (why would we run one if we already have awesome CLion?), also there were SEGGER license limitations, etc.

Of course, I wasn’t happy having all of those problems and tried to find better solutions. Now it’s time to show what I’ve managed to achieve. Fortunately, during this time, both CLion and CubeMX were improved a lot, made more stable, and, most importantly, CLion now supports remote GDB. Now it’s possible to use OpenOCD (Open On-Chip-Debugger) as a flash probe and as a remote gdb server. This unlocks the possibility to get rid of both SEGGER license limitations and using a commercial debugger in favor of open-source tools. Also, there is no need anymore to reflash any on-board probes, we can use it as-is, even for flashing your production target devices (refer to ST Nucleo or Discovery board user reference).

I managed to run this environment with vanilla CLion, but the project setup was quite complicated and time-consuming, and at some point, it turned into the idea to write my own plugin for CLion, which puts it all together. Now the plugin is in beta stage, published to the JetBrains plugin repository, and I am glad to show how it works. Today we will run a small demo project (It’s gonna be blinking LEDs! Surprise!) using one of the most popular boards – STM32F4-Discovery. The same example, with minimal changes, can be done using any of STM32 board of Nucleo, Discovery or EVAL series, since they all have LEDs onboard.
Continue reading

Posted in Tips'n'Tricks | Tagged , | 33 Comments