user38196: Why in the piece of code below we use "static volatile bool"?
static volatile bool wifi_connected = false;

taken from here: https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino

user359: static means that the global will only be accessible inside the current translation unit.
volatile means that while(!wifi_connected){/*...*/} cannot be optimized to if(!wifi_connected)while(true){/*...*/}
These things are orthogonal. So you would use static volatile when you need both properties. 

38196: <p>Why in the piece of code below we use "static volatile bool"?</p>

<pre><code>static volatile bool wifi_connected = false;
</code></pre>

<p>taken from here: <a href="https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino" rel="nofollow noreferrer">https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiIPv6/WiFiIPv6.ino</a></p>
 359: <p><code>static</code> means that the global will only be accessible inside the current translation unit.</p>

<p><code>volatile</code> means that <code>while(!wifi_connected){/*...*/}</code> cannot be optimized to <code>if(!wifi_connected)while(true){/*...*/}</code></p>

<p>These things are orthogonal. So you would use static volatile when you need both properties. </p>
