Reputation: 5856
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 for char
since they have the same size (1 byte). No clue why though
Ultimately declares a string (a const char
array) by inferring the array size from the string length whose 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:
Upvotes: 0
Views: 516
Reputation: 716
This is compiler dependend. However my guess is that this code declare an array named server_root_cert_pem_start and binds it to another symbol (memory location) _binary_server_root_cert_pem_start probably defined elsewhere (in an assembly file?)
Upvotes: 1