Question about Dir 4.3 when a static function contains only variable declaration, asm and return statement

Moderators: misra-c, david ward

chenzhuowansui
Posts: 3
Joined: Wed Feb 20, 2019 5:59 am
Company: Synopsys

Question about Dir 4.3 when a static function contains only variable declaration, asm and return statement

Postby chenzhuowansui » Sat Jun 29, 2019 10:39 am

Hi,
Given the following case:

Code: Select all

static inline uint32_t test(void)
{
    uint32_t tmp;

    __asm__ __volatile__(
        "mrc p15, 0, %0, c1, c0, 2\n\t"
        : "=r" (tmp)
        );

    return tmp;
}


i wonder if we could take the above case as compliant, as we cannot have variable declaration and return value in assembly. Thanks

Return to “7.4 Code design”

Who is online

Users browsing this forum: No registered users and 1 guest