Lorah Attkins
Lorah Attkins

Reputation: 5856

C array declaration with inline assembly

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:

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

Answers (1)

Damiano
Damiano

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

Related Questions