SHARE
Facebook X Pinterest WhatsApp

Re: Linux -rc3 “In other words: don’t be stupid.”

Written By
thumbnail
Web Webster
Web Webster
Jun 15, 2011

“On Tue, Jun 14, 2011 at 5:15 AM, Denys Vlasenko wrote:
>
> I’ve got a patch for my project to fix parsing of kernel
version which > has only two numbers. Basically,
> – scanf(ver, “%u.%u.%u”, &a, &b, &c)
> + sscanf(ver, “%u.%u”, &a, &b)

Please just fix it.

The projects that care about kernel version are buggy in so many
ways that it’s not funny.

It’s not just the “two versus three digits” bug either. The
*bigger* bug is usually that the tests are done the wrong way
entirely, namely to fail when you cannot parse the version. And
that’s just f*%!ing stupid!

If you cannot parse the version, then rather than fail, a
project should have gone “uh, it’s some future version that I don’t
recognize or some other OS entirely, so I’ll just do whatever the
most modern thing is”. Having an “assert()” or returning an error
is just the mark of incompetence.

So please just fix things. Preferably by removing the version
check entirely, but if you really feel that you cannot do that,
then AT LEAST realize that the reason you’re looking at the version
is to support *old* versions, not new ones, and make the logic work
that way (so that next time around, when we change the version
numbers to be sanscrit characters and you fail parsing them
*again*, you don’t actually fail, you just go “oh, this is modern”
and go on with your life).

In other words: don’t be stupid.

Ok?

Linus

Complete
Story

thumbnail
Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Recommended for you...

Germany Puts Microsoft on Five Years Probation for Antitrust Bullying
brideoflinux
Oct 12, 2024
Linus Torvalds Expresses Frustration With Bcachefs Development Process
Senthil Kumar
Oct 7, 2024
Mozilla Thunderbird Lands On Android With New Beta Release
Senthil Kumar
Oct 1, 2024
Tor and Tails Merge to Fight Global Surveillance and Censorship
Bobby Borisov
Sep 26, 2024
Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.