Похожие чаты

@QNeko @MasterZiv I don't see anything there specifying your described

behavior of static variables inside functions. Also i can't see anything you described in my armv7e-m disassembly 🤔

Is it maybe OS/compiler dependent? Would be nice to know if and whers something like u describe exists

5 ответов

7 просмотров

they are static local variables

https://godbolt.org/z/ReY13f

on ARM: https://godbolt.org/z/XcxPNy

Variables declared at block scope with the specifier static have static storage duration but are initialized the first time control passes through their declaration

This article describes behavior of static variables inside any block , including function body. https://en.cppreference.com/w/cpp/language/storage_duration#Static_local_variables Unless section (unless their initialization is zero- or constant-initialization, which can be performed before the block is first entered)says that in these particular cases initialization can be performed earlier then first time control passes through the declaration.

Похожие вопросы

Обсуждают сегодня

Hello Everyone 🙌🏻💜 Happy (?) Friday to everyone 😁😁 I have read through all the comments/feedback/complaints in the last 2 days following the CEO Update AMA. Clearly the ...
Patrick - Ultra.io
4
How did we have so many dormant scammers in here? Who are these people. It’s been years. We know each other. If you dm me “I’ve been an og” but haven’t said a single word her...
Justin | LGCY |
42
Кстати, а я вот тут подумал. Допустим, у нас имеется цикл который выполняет огромное количество итераций, но мы хотим, чтобы какие-то действия исполнилось только один раз. В Я...
The Bird of Hermes
23
Доброй ночи. Вопрос знатокам. Имеется некая таблица, результат которой выведен в DBGrid на форме. И есть форма, с помощью которой можно как добавить запись, так и отредактиров...
Евгений
28
🌟 Great News from Dypius! 🌟 We're happy to announce the Early Access launch of the Dypius Mobile App by the end of this month! Let's dive into the features you'll get to exp...
DYP | Tim
3
Guys I want to exec into a container running on Fargate like this: aws ecs execute-command --cluster my-cluster --task task_id --container app --command bash --interactive ...
Ehsan
14
а всё почему? потому что ассемблер в отличии от яву порождает множество пагубных привычек, среди которых например можно отметить использование глобальных переменных для всего ...
Mixail Frolov
35
Dan continues to show up to AMA's, supports and speaks about ergo, hired two ergo devs to be part of the team, developed open source software that anyone can use on ergo, offe...
qx()
24
Всем привет 👋 Подскажите пожалуйста, а чего тут не хватает permission или образ битый? Running with gitlab-runner 17.0.0 (44feccdf) on gitlab-runner-c58775949-d7znz YxYz2zp...
Max
2
анрей С какой целью зашёл?
КТ315
42
Карта сайта