I recently came upon this snippet:
extern const uint8_t server_root_cert_pem_start[] asm("_binary_server_root_cert_pem_start");
// ^^^^^^^^^^^^^ what's going on here?
in the esp-idf examples(line 74). I cannot understand the declaration, and my online search hasn't been successful. My best guess would be that this code:
Uses
uint8_t
as a replacement forchar
since they have the same size (1 byte). No clue why thoughUltimately declares a string (a
const char
array)by inferring the array size from the string lengthwhose length has been specified outside our module
Even if my assumptions are correct, I fail to understand why it's written this way or what happens with "null termination" in this case. So the actual questions:
- What is this code doing?
- Why is it doing it this way (advantages)?
- Are there any implications that differentiate it from a simple C-style declaration?