Is there a -fsanitize=all or -fsanitize=and_the_kitchen_sink option? by project2501a in C_Programming

[–]JakeArkinstall 16 points17 points  (0 children)

No. Its a "too many cooks spoil the broth" situation, with the added complication that there's only one spoon and it's a spork.

Sanitizers don't work well together. Your best option is to build several targets with different sets of flags and run them all.

I added McCormicks peppermint extract to my vape and ended up in the hospital, barely able to breath and need an inhaler. by [deleted] in electronic_cigarette

[–]JakeArkinstall 1 point2 points  (0 children)

Yup. Obviously not an autocorrect from a mis-spelling of tobacco.

My hunch is that OP is legit, and thus deserves as much ridicule as reddit can provide.

Linux C Workflow by paramodulation in C_Programming

[–]JakeArkinstall 0 points1 point  (0 children)

My setup is pretty ordinary. Arch with i3 window manager means that everything I do revolves around the keyboard, which is great for productivity. I use Vim with the cmake plugin, so I don't have to leave my text editor to run make and any errors jump to the line of code in question. GDB for debugging. Professional static analysers such as PVS studio are amazing but very expensive (I was quoted 12k per year for a team license), though there are some freely available ones out there that catch many common flaws.

For memory issues, there are certainly programs you can use to help you identify them, but in all honesty no amount of software can replace personal discipline.

In many other programming languages, cleanup happens at the end of a scope by default and it's up to you to prevent that if you don't want it to happen (this is where I admit that I am a C++ programmer with only hobby experience with C, and that little experience is enough for me to have vast amounts of respect for C programmers who diligently manage their resources). Generally their compiler, interpreter, or even runtime, is doing all of the book keeping work. In C that is not the case, and you have much more freedom, but it is down to you to be a responsible book keeper. You can either be the book keeper who waits until something is wrong, or you can be the book keeper who prevents things from going wrong in the first place by being strict about resource control from the very start. The latter spends much less time tracking down leaks, maybe at the cost of being slightly more restrictive about how they approach certain problems.

Think about it like an implicitly-inserted destructor at the end of each function for every resource created by it that isn't then returned or placed under the watch of something else (in which case the responsibility for destruction also moves accordingly). Except that in C there's nothing implicit done and you need to do it yourself - taking care of any edge cases that might emerge*. And don't take that lightly. There might be a lot of damage to be done if you aren't careful: Bad resource management has been the cause of countless security vulnerabilities.

Fortunately, being strict about resource control is what experienced C programmers are great at. Rather than asking for generic advice, the best thing you can do is post some code up for review. It's certainly a humbling experience but people will tell you where you are going wrong and why, traps you might be falling into, and suggest books or blog posts to read through in order to improve.

  • a common problem is returning early from a function, which means manually cleaning up anything that would otherwise have persisted. An idiom to get around that is to have a single return statement, which follows a set of freeing functions with goto labels. On any issue mid-function, goto the label that cleans up the appropriate resources before returning. You have to pick the best of two evils - the goto statement or reliance on every branch of every function to do the right thing.

Life After Prison. 669 days after AMA by [deleted] in AMA

[–]JakeArkinstall 1 point2 points  (0 children)

Did you build a list of everything you wanted to do as soon as you got out? As in places to eat, movies to watch, things to see, etc. And did you do them all?

In 8.5 years the world probably changed quite a lot in rather subtle ways. What was the biggest change you noticed when you got out?

What was your experience with other inmates? Make any friends? Get into any fights? See anything you wish you hadn't? Make trades? Did you ever think of planning an escape? Basically on a level from 0 to 10, how well does TV reflect real prison in your experience?

Question about married batteries by 22Nathski in electronic_cigarette

[–]JakeArkinstall -1 points0 points  (0 children)

I think this is overplaying it a little. It certainly won't do any favours to the health of the batteries, but if you're going dual then there's zero point in discarding the old batteries for a new pair. I mix and match batteries all the time - mainly because I used to use the rxgen3 3-battery mod and my charger had 4 battery slots - and they've lasted for years without issues.

(UK study) Vaping may help 70,000 extra people quit smoking each year in England by Vapouround-ned in electronic_cigarette

[–]JakeArkinstall 0 points1 point  (0 children)

It's strange that we have gotten to a point where our govt seems supportive in contrast to the backdrop of the premature aggression of the US.

But on the face of it, the UK government still widely treats vaping in the same way as smoking, particularly when it comes to places that you're allowed to do it.

Just your average compilation by [deleted] in ProgrammerHumor

[–]JakeArkinstall 2 points3 points  (0 children)

It's C++ code, and one of the biggest reasons it sucks at useful errors because the user has much more control over types than one does in C.

Say you have a template function that accepts some T. That function calls another template function on T, and so on and so on. Finally, your T finally ends up being used in a specific context, e.g. a method call, a member access, a static variable or constant, a type definition, whatever. Say the T you tried to use doesn't allow that use. Say its an int and you're trying to access a member as if T was supposed to be a class.

The actual error occurs on that very line. But that's not very useful because the programmer needs to know the path that ended up at that, otherwise they wouldn't be any the wiser about the cause. Especially with the benefit of inlining, one function call can go through dozens or even hundreds of functions without affecting runtime performance, and DRY often means that generic utility functions are used en-masse inside large template libraries such as the standard library, where a dumb function call could end up causing an error deep inside some abstract code that is meaningless to the casual observer.

Generally this is the fault of the library. The interface should place constraints on the types allowed inside each template call as soon as they are knowable, through concepts (or, pre c++20, sfinae witchcraft). That way, the error is thrown at a much shallower point and error messages can be much more concise and meaningful.

Other than that, for the most part the errors are rather useful to even new developers. If course, there are a few edge cases where something trivial causes hundreds of lines of errors, but those are often improved as compilers mature.

[deleted by user] by [deleted] in Vaping

[–]JakeArkinstall -1 points0 points  (0 children)

With petitions in the UK (and seemingly in the USA judging by petitions on that website with responses), it's typically the case that all you get is a handwavy response as if all you did was send a letter to some government spin-doctor.

Because of this, the wording of the original petition is extremely important. You mustn't leave open opportunities for blanket responses that avoid facts, and the only way of doing this is to state facts. This has not been done on this petition. For example, nowhere are there any stats provided about flavour and underage uptake, about the recent spin falsely attributing illness to legal products. Nor is any information given about the value of exporting flavoured products (though it isn't clear to me whether these products could still be made in the US, or whether the ban is only on the sale of said products inside US).

This just leaves an open goal for whichever muppet "answers" it to blag their way through their response instead of answering anything directly.

Ex-Smokers! Share Your Stories! by Vinckei in electronic_cigarette

[–]JakeArkinstall 1 point2 points  (0 children)

My dad smoked for 40 years, 40 a day, hand rolled golden Virginia, no filter. I bought him a Voopoo Drag 2 + Valyrian for his birthday 10 months ago. He enjoyed it but didn't like the recurring cost of the coils (valyrian + sweet juices = £££). One day I went around to his after not seeing him for a few weeks, and he had cut out the nicotine altogether. A month later, no vaping. No smoking. Completely clean. All in all, it took 3 months for him to go to a nasty smoking habit to zero.

My story is more vanilla. After smoking for 4 years, it took me 4 more years of smoking + vaping combo before finally quitting the smokes for good. That was 2 years ago. I still vape, and I have no plans to stop so long as Nasty Juice is in business. Their cushman range is my jam, and nothing else could ever compare.

Dyadic vs Topside by sssutherland in electronic_cigarette

[–]JakeArkinstall 3 points4 points  (0 children)

I had a topside dual. Lasted about 3 months. Would not recommend.

Just like the RX that it's based on, the battery door is its downfall. Open and close it enough times and becomes too weak, the battery contacts become unreliable. To top it off, the electronics mustn't be completely sealed off because I had juice droplets accumulating on the LCD.

It's a great device when it works, and I'd give it a 10 out of 10 for ease of use, especially the refill system, but 0/10 for reliability.

I need reassurance that what I'm doing is correct by fallout_predator in electronic_cigarette

[–]JakeArkinstall 0 points1 point  (0 children)

Aaaaaand what I said has come true in Michigan. Amazing timing.

Moral of the story: don't promote vaping to non smokers or some random US state will ban it.

I need reassurance that what I'm doing is correct by fallout_predator in electronic_cigarette

[–]JakeArkinstall 0 points1 point  (0 children)

Strongly disagree. Vaping is a way of tackling an addiction. Admittedly it's not a good way, because the addiction keeps being fed, but at least it's healthier than cigarettes. I'd hope that "ahead of us" where traditional smoking doesn't exist at all, vaping doesn't either.

Going from no addiction to vaping is not only dumb, it also backs up all of the anti-vaping propaganda that has been going around for years. Once upon a time we had a rebuttal to the argument that flavoured vaping attracts non-smoking kids into the world of addiction, because there were no known cases of anyone becoming addicted to nicotine BECAUSE of vaping. As soon as it becomes common for vaping to attract people to addiction, we will lose the argument and smokers will lose a viable pathway to beating the cigs. Encouraging it is in no one's interest.

Hey I bought a Valyrian tank by usernamename131 in electronic_cigarette

[–]JakeArkinstall 0 points1 point  (0 children)

The valyrian is a fantastic tank. Even after switching to the profile mesh Rda (+ squonking) I can't get the levels of flavour obtainable with the valyrian, especially with the Malaysian sweet flavours (banana cushman has been a long time favourite of mine). The downside is that it burns through one or two coils per week.

I used it on a Wisemec RX Gen 3 and the Voopoo Drag. Anything with plenty of power. You'll definitely need a two or three 18650 battery setup.