Not sure that this is the right place to ask. I use platformio 4.3.4 with the arduino framework. In various sketches that I looked at, it is implied that loop() is called within an endless loop so ...
In order to make it easier for beginners to get started with writing Arduino sketches, and for the convenience of all users, Arduino CLI automatically generates and adds prototypes for functions ...