Language Selection

English French German Italian Portuguese Spanish

GCC, Useful Versus Useless Warnings

Filed under
Linux

Linux creator Linus Torvalds proclaimed, "friends don't let friends use '-W'," in a thread discussing GCC's handling of warnings. The thread began with a patch to remove an unnecessary comparison of an unsigned variable which resulted in a GCC warning, "comparison of unsigned expression < 0 is always false". Linus suggested it is better to write readable and obvious code, "without having to carry stupid context around in our heads". He went on to add, "if the compiler (whose _job_ it is to carry all that context and use it to generate good code) notices that the fact that 'x' is unsigned means that one of the tests is unnecessary, that does not make it wrong." As has been noted in several earlier lkml discussions [story], Linus concluded, "Gcc warns for a lot of wrong things. This is one of them."

Later in the thread, Linus pointed out that GCC also offers plenty of useful warnings as well.

Full Story.

More in Tux Machines

Canonical Releases Snapcraft 2.12 Snaps Creator with New Parts Ecosystem, More

Today, June 29, 2016, Canonical has had the great pleasure of announcing the release of the highly anticipated Snapcraft 2.12 Snappy creator tool for the Ubuntu Linux operating system. Read more

AMDGPU-PRO Driver 16.30 Officially Released with Support for Ubuntu 16.04 LTS

Today, June 29, 2016, AMD released the final version of the AMDGPU-Pro 16.30 graphics driver for GNU/Linux operating systems, bringing support for new technologies like the Vulkan API. Read more

Red Hat News

Peppermint 7 Released

Peppermint 7 launched a few days ago. Peppermint is a lightweight Ubuntu-based Linux distribution with an emphasis on speed and simplicity. Although the name is similar to Linux Mint, the projects aren't directly related. Peppermint originally was envisioned as a "spicier" alternative to Mint—whatever that means! Many distros come with a wide assortment of feature-rich applications, and that's great for power users who need those apps. But older machines can struggle to cope with those demanding distros. Peppermint solves the problem by offering a carefully curated suite of web apps that perform tasks traditionally handled by native apps. It's an approach that will be familiar to any Chromebook users reading this article. Read more