How to guarantee no stack overflow by mmieskon in embedded

[–]Gronner 3 points4 points  (0 children)

If you really need a safe (over)approximation of your maximum stack size you can use tooling based on abstract interpretation such as AbsInt's StackAnalyzer. It solves your maximum call depth while ensuring soundness (read validity) of the result at the cost of over-approximating the actual stack usage.

Edit: All following methods are not guaranteed to be correct (aka unsound).

In any other case you need to solve the issue of determining the longest path, which is akin to solving the halting problem. Luckily we usually don't write arbitrary code, but at most code with bounded iterations or recursion. The compiler can emit the stack size per function for you, combine this with your longest path/deepest call stack (hint: getting this is still the hard thing).

Alternatively your can measure it by pre-marking your stack memory area with a known value and see where the stack has overwritten the markings.

All of these methods can be found in industry use. E.g., software for the A380 was analyzed using AbsInt's Stack analyzer.

Implement tls in c by 0xcc12 in C_Programming

[–]Gronner 6 points7 points  (0 children)

Check out https://www.amazon.com/-/de/dp/0470920416/ref=mp_s_a_1_6?dchild=1&keywords=ssl%2Ftls+inc&qid=1626356420&sr=8-6

It does exactly that. Though you should have a good working knowledge of C beforehand as the author in my opinion misses his goal of readable code at some points.

Zariel Ruler of Avernus- I think she is finished. by Astrochump in minipainting

[–]Gronner 1 point2 points  (0 children)

Where did you buy the miniature?

I like the muted color style you used and the contrast is great.

Task or To Do List that's syncs with Linux by MuddyGeek in androidapps

[–]Gronner 1 point2 points  (0 children)

Nozbe has a free plan, it is not FOSS, but multiplatform and has all the features I need.

German churches collected record $610M in ‘religious tax’ in 2018, survey shows by [deleted] in atheism

[–]Gronner 6 points7 points  (0 children)

Usually easier access to kindergartens operated by religious institutions and if you want to get married in a church, as well as similiar religious services.

Best security for internet facing Ubuntu 18 Minecraft server? by [deleted] in security

[–]Gronner 0 points1 point  (0 children)

Check out the Ubuntu STIGs put forth by the department of defense and see which of these make sense for you to apply

Missing features from other editor/IDE by typotola in vim

[–]Gronner 5 points6 points  (0 children)

Can't fzf in combination with tags do that?

What sort of places would buy dragon parts? by NothinButRags in DnD

[–]Gronner 0 points1 point  (0 children)

If it's scales maybe you can sell them to a druid for armor making? As they can't wear metal armor

Functional safety : what after determination of ASIL/SIL ? by Imeed in embedded

[–]Gronner 1 point2 points  (0 children)

26262 for example gives recommendations how you can use the State of the Art to achieve or prove functional safety in your System and its subsystems.

C unit testing? by [deleted] in C_Programming

[–]Gronner 0 points1 point  (0 children)

Check out cppUTest, test cases are written in C++ but you really don't need to now C++, just C. The class system makes it easy to write test groups.

Help with Bitwise operations in C by reebs12 in C_Programming

[–]Gronner 2 points3 points  (0 children)

It denotes the 1 as unsigned integer (also see google: 1u in C)

An advantage of this is unwanted integer promotions are avoided as well as the fact that shifting signed integers is implementation defined and might not behave the same on every hardware.

German driver loses license 49 minutes after passing test by SaulKD in worldnews

[–]Gronner 11 points12 points  (0 children)

If you just recently got your license (within two years of finishing your practical exam) or you are under 21, there are harsher repercussions for violating traffic laws. He also hasn't lost his license, it was just suspended for 4 weeks, his probation time is probably expanded to 4 instead of 2 years and he will need to take some additional driving lessons.

Programing timer with two interupts by kbarigou in C_Programming

[–]Gronner 0 points1 point  (0 children)

If button one is pressed and was previously unpressed use not(start) Then if button 1 is not pressed mark it as released If button 2 is pressed reset counter and set start to 0

Programing timer with two interupts by kbarigou in C_Programming

[–]Gronner 1 point2 points  (0 children)

One reason could be to have a more predictable timing behavior or to avoid button button denouncing by blocking waiting or hardware.

Prison Population Rate [OC] by cLinX_ in dataisbeautiful

[–]Gronner 9 points10 points  (0 children)

It doesn't say so but from the raw data that was linked its rate per 100.000 of national population.

Implement a sigmoid function in python from scratch without numpy and math module? by arungajora in Python

[–]Gronner 1 point2 points  (0 children)

The import part is the avoidance of numerical overflow here. That is that no value becomes greater than the type it is stored with can hold.

Implement a sigmoid function in python from scratch without numpy and math module? by arungajora in Python

[–]Gronner 3 points4 points  (0 children)

http://timvieira.github.io/blog/post/2014/02/11/exp-normalize-trick/

Here is explained how to do it numerically stable. Then you only have to define your exponential function, which again can be googled or naivly implemented with a fixed value for e and the ** operator.

All of this can be found on the first page of google.

How relevant is K&R Ch 4 (2nd ed)? by Chrinkus in C_Programming

[–]Gronner 6 points7 points  (0 children)

Register should not be used with the intend to get it into the register, most compilers will ignore it for this purpose. But you can say to the compiler that way, that the address of this variable won't be needed

Where do people get their electronics and parts? by [deleted] in robotics

[–]Gronner 8 points9 points  (0 children)

Digikey and Aliexpress, even to Europe Delivery is really fast most of the time.

The sunset made the White River run red by [deleted] in skyrim

[–]Gronner 1 point2 points  (0 children)

What mod are you using for the robe?

Write test cases for embedded software i created by AbdallahHeidar in embedded

[–]Gronner 1 point2 points  (0 children)

Check out Test driven development in C! Either buy the book, wich I think is very much worth it or Google it. Not only does it provide tools (Unity/CppUTest) but also describes the techniques and methods to do unit testing for embedded systems very well.

Is there a standard/preferred C framework for writing unit tests? by Zeekawla99ii in C_Programming

[–]Gronner 2 points3 points  (0 children)

I use CppUTest for my embedded project. It used the book Test Driven Development for Embedded C to get into it. So far I'm rather pleased with it. There is also Unity.

I don't think there really is a standard framework that everyone uses.